Solving Error “ERROR 1 (HY000): Can’t create/write to file ‘/tmp/#sql_9f3_0.MYI’ (Errcode: 17)”
Recently a site that we manage stopped working all of a sudden. The error being returned from the MySQL query was as follows:
ERROR 1 (HY000): Can't create/write to file '/tmp/#sql_9f3_0.MYI' (Errcode: 17)
The error states that a file in the ‘/tmp/’ folder can’t be written to, but why?
My initial thoughts were that it might be down to permissions on the folder. That would be odd however as it’s been fine for many years. Sure enough, the permissions on the folder were fine. So what else would cause an error like this?
After much investigation, it turns out that the /tmp/ file on the server was full. Although there were only about 20 files in this folder, a couple of them were huge.
I’m not sure where these huge files originated from, however after removing them the site in question came instantly back to life.