Unmanaged dedicated server and Cloud VPS users, who are familiar with making root-level configuration changes, can adjust the MySQL /tmpdir to a new location by following these steps:

  1. Login as root to your server via SSH.
  2. Open the /etc/my.cnf file in your preferred editor, eg:
  3. nano /etc/my.cnf

  4. Locate the [mysqld] section and add the following line beneath it:
  5. tmpdir=/home/mysqltmp

    In this example we're using /home/mysqltmp as the new location. Replace with your desired file path here.
  6. Save changes (Ctrl + O) and exit from your editor (if using nano press Ctrl + X)
  7. Now create the directory specified above. Continuing with our example:
  8. mkdir /home/mysqltmp
    chmod 1777 /home/mysqltmp
  9. Restart mysql via WHM or use the command:
  10. /etc/init.d/mysql restart
  11. Finally re-connect to the server terminal to check that the change has been effective, use this SSH command:
  12. mysqladmin var | grep tmpdir
  13. A successful response looks something like:
  14. | slave_load_tmpdir                       | /home/mysqltmp
    | tmpdir                                  | /home/mysqltmp
Was this answer helpful? 0 Users Found This Useful (0 Votes)