Hi all

I'm running MySQL 4.0.12 and i need to change the value of the tmpdir variable due to permission issues. Does anyone know how and where to do this!? I've been scratching my head with this one all morning. I'm running WinXP.

Regards,
Jon

    Have you already read this page of the MySQL manual?

    You should be able to specify the tmpdir option in your my.cnf/my.ini config file.

      Hi bradgrafelman.

      Thanks for the reply. I have had a look at the documentation but even when i put the following line in my 'my.ini' the variable value still doesn't change:

      my.ini

      tmpdir=C:\WINDOWS\temp_mysql\
      

      If i then run the following statment in MySQL

      SHOW VARIABLES LIKE 'tmpdir';
      

      'C:\WINDOWS\TEMP\' is returned.

      Any ideas?

      Also does anyone know if the tmpdir variable is global or on a per-database level?

      Regards,
      Jon

        Do you mean the upload tmp directory? You have to change it in php folder/php.ini

        Look for this line. upload_tmp_dir

        And change to the directory you want.

          Hi Joseph07.

          No it's not the upload tmp directory. This is strictly a MySQL issue rather than PHP.

          MySQL accesses temporary MYD files within it's defined temporary directory. However these files are being accessed by a virus scanner which locks and scans the MYD file when they are opened. If the MYD files are large enough the virus scanning application and MySQL bump into each other causing intermittent (fatal) errors.

          Regards,
          Jon

            I see. My wrong for interpreting wrongly.

            I'm not that good with mySQL, hope that you can get the answer soon.

              The tmpdir variable, if not specified, will default to your system's default temporary folder (the 'TEMP' folder in your Windows folder, obviously).

              To specify the tmpdir variable, make sure you add it to your my.ini file after the [mysqld] header. For instance, I have:

              [mysqld]
              old_passwords=1
              
              # The TCP/IP Port the MySQL Server will listen on
              port=3306
              
              #Path to installation directory. All paths are usually resolved relative to this.
              basedir="C:/Program Files/MySQL/MySQL Server 5.0/"
              
              #Path to the database root
              datadir="X:/web/mysql/data/"
              
              tmpdir="X:/web/mysql/tmp/"

              After you add that variable under the mysqld header, make sure you restart your MySQL server.

                Perfect. Thanks for the resolution.

                  Write a Reply...