/tmp full due to MySQL spool files. Can I do this to resolve this.....

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
Hi. With greater frequency lately I am getting warnings about the /tmp partition being full, or very nearly full. When I look into this, I see large MYD and MYI files are eating up all the space. (BTW, I know why, this is occurring, e.g. MySQL is running out of ram and so on.)

So then I created a folder out side of /tmp for this, and inserted the following in /etc/my.cnf

tmpdir = (path and name of outside folder here).

I restarted MySQL and all, but the MYD and MYI files are still being created in the /tmp partition.

Are there any steps I am missing which would make this work?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Hello :)

Yes, please follow the instructions in the thread mentioned in the previous response. You can confirm the new MySQL tmp directory with the following command:

Code:
# mysqladmin var | grep tmpdir
Thank you.
 

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
Regarding this from the other post, "This presumes / partition itself has sufficient space. I would like to hope / partition would have more space than /tmp was provided on most systems. "

Would there be any issue with putting /mysqltmp in the /home directory, and then of course configuring my.cnf accordingly? E.g. for:

/home/mysqltmp

???
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,201
363
Yes, utilizing the /home partition is an acceptable alternative to the root partition.

Thank you.