How To Change MySQL Temporary Directory ?

Started by Administrator, April 21, 2014, 05:16:12 PM

Previous topic - Next topic

Administrator

Hi Members,

By default the temporary directory for your MySQL server is set to /tmp folder. When you perform any queries, repair the tables, perform tasks on the database, etc; the temporary files are stored in this directory.

Just in case, if the /tmp partition is running out of space you can either delete these files OR create a new directory with large disk space. Assign this directory as temporary directory for MySQL server.

Open MySQL configuration file in your favorite editor

Quotevi /etc/my.cnf

Add the line below & save the file.

Quotetmpdir = /home/mysql-tempdir

Create the folder on your server and set ownership and permissions as below.

Quotechown mysql.mysql  /home/mysql-tempdir
chmod 1777 /home/mysql-tempdir

Restart MySQL service & you have successfully changes the temporary directory.

Cross check it with the command below.

Quotemysqladmin variables | grep tmpdir

Feel free to reply this thread if you face any other issues.
MilesWeb - Your Hosting, Our Responsibility!
Buy Web Hosting Plans | Managed VPS with 50% Discount