[mysql] Changing the tmp folder of mysql

Our Mysql queries use temporary tables which creates temporary files in the process. Currently the files are written to /tmp. How exactly can the path of the temp folder to which mysql writes to be changed?

This question is related to mysql tmp

The answer is

You should edit your my.cnf

tmpdir = /whatewer/you/want

and after that restart mysql

P.S. Don't forget give write permissions to /whatewer/you/want for mysql user

Similar questions with mysql tag:

Similar questions with tmp tag: