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

Problems with the Linux version of XAMPP, questions, comments, and anything related.

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

Postby dahliorse » 18. September 2006 10:30

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,

Posts: 1
Joined: 18. September 2006 09:23
Location: Sweden

Postby Izzy » 18. September 2006 13:02

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:
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?

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:
Can't create/write to file '/root/tmp/ibw7TWlD' (Errcode: 13)

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:

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.
Posts: 3344
Joined: 25. April 2006 17:06

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 8 guests