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:
- Login as root to your server via SSH.
- Open the /etc/my.cnf file in your preferred editor, eg:
- Locate the [mysqld] section and add the following line beneath it:
- Save changes (Ctrl + O) and exit from your editor (if using nano press Ctrl + X)
- Now create the directory specified above. Continuing with our example:
- Restart mysql via WHM or use the command:
- Finally re-connect to the server terminal to check that the change has been effective, use this SSH command:
- A successful response looks something like:
nano /etc/my.cnf
tmpdir=/home/mysqltmpIn this example we're using /home/mysqltmp as the new location. Replace with your desired file path here.
mkdir /home/mysqltmp
chmod 1777 /home/mysqltmp
/etc/init.d/mysql restart
mysqladmin var | grep tmpdir
| slave_load_tmpdir | /home/mysqltmp | tmpdir | /home/mysqltmp