Page 1 of 1

#1 - Can't create/write to file '/root/tmp/#sql_1cbf_0.MYI'

PostPosted: 18. September 2006 10:30
by dahliorse
I've just downloaded and installed xampp for linux.

Every time I try and view a table I've just created I get:

#1 - Can't create/write to file '/root/tmp/#sql_1cbf_0.MYI' (Errcode: 13)

I have noticed someone else has had similar problems on this forum http://community.apachefriends.org/f/viewtopic.php?t=19663

I but that did not get me anywhere.

I'm aware that this is a permissions problem.

I'd be grateful for any help,

dahliorse

PostPosted: 18. September 2006 13:02
by Izzy
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.