Running Magento
and every 3-15 days or so (fairly random) I get this error:
exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[HY000]: General error: 1 Can't create/write to file '/tmp/#sql_362_0.MYD' (Errcode: 17)' in public_html/lib/Zend/Db/Statement/Pdo.php:234
And yes indeed /tmp/#sql_362_0.MYD
file exists. 0 bytes, owner MYSQL:MYSQL
.
The only way to recover from this is to delete the file (or restart nginx/mysql/server
).
I'm tempted to write a CRON to check and delete this file every minute... Though I'd prefer a better solution.
It's always the same filename. I'm assuming it's some sort of a bug or crash and MYSQL is not deleting the file. The entire site goes down if this file exists in the /tmp/
folder and requires my manual intervention to get it back up.
I know there are many discussions of solution to this error, disks being full etc. This does not seem to be the case (main partition with 1GB free).