Mysql – Can’t create/write to file ‘#sql_1fc7_3.MYD’ (Errcode: 17)
MySQL
Can't create/write to file '#sql_1fc7_3.MYD' (Errcode: 17)
how can i fix that?
Best Answer
Error 17 is "file exists".
See if anything else has #sql_1fc7_3.MYD open:
lsof | grep '#sql_1fc7_3.MYD'
If it doesn't, then move it. I'm not sure what led to this problem, but one guess is that MySQL crashed at some point and as a result didn't clean up a temp table's file named #sql_1fc7_3.MYD.
It looks like your permissions on /tmp are wrong. They really should be read/write/execute for everyone with the sticky bit set.
chmod 1777 /tmp
The sticky bit add some restrictions to how other users interact with files not created or owned by them, so there's no reason to worry.
If you wish, you may also create a seperate directory owned and writeable by the mysql user and specify that directory in my.cnf to be used instead of the system wide /tmp.
Best Answer
Error 17 is "file exists".
See if anything else has #sql_1fc7_3.MYD open:
If it doesn't, then move it. I'm not sure what led to this problem, but one guess is that MySQL crashed at some point and as a result didn't clean up a temp table's file named #sql_1fc7_3.MYD.