MySql is trying to use /root/tmp instead of /tmp.
This reply was posted on another forum. It might help as it explains things a bit clearer:
Question:
Error number: 1
Error message: Can't create/write to file '/root/tmp/#sql_2aeb_0.MYI' (Errcode: 13)
Why is it attempting to write here and how do I stop that?
Answer:
I think it's your mysql setting's problem. Mysql uses $TMPDIR to store temporary files, these files are usually hidden and removed once mysqld is terminated. If you do not have $TMPDIR set for mysql, it uses system default, usually /tmp, /var/tmp, etc, in your case, mysql picks up /root/tmp, which is the $TMPDIR under root environment.
To fix this problem, you can specify a tmpdir path to a directory which is writeable by globle user, to do this, just add tmpdir to the option file (my.cnf) under [mysqld] section.
Here is another with a different solution and one I am not familiar with:
Question:
Can't create/write to file '/root/tmp/ibw7TWlD' (Errcode: 13)
Answer:
Here's what I did to resolve this issue.
export TMPDIR=/path/to/chosen/dir; (eg /tmp/)
Here is another link to a similar solution to the link you gave but again a tad clearer perhaps:
http://community.apachefriends.org/f/viewtopic.php?p=82054
This is the section in the my.cnf that seems to be referenced:
- Code: Select all
# Point the following paths to different dedicated disks
#tmpdir = /tmp/
Uncommented it would look like this:
- Code: Select all
# Point the following paths to different dedicated disks
tmpdir = /tmp/
Make sure you have the /tmp directory with world write permissions 777.
On my dedicated servers I make it sticky too 1777.
/root/tmp is of course a different directory and mysql would not have permissions to use that for temporary storage as it would be owned by root.