MySQL / InnoDB / Incorrect key file for table Error

innodbMySQL

I keep seeing this pop up in my logs every few hours.

Trying to get property of non-object -- Incorrect key file for table '/tmp/#sql_ad2_2.MYI'; try to repair it

I ran mysqlcheck on all tables, but I still get it. Is there anything else I can do?

Best Answer

the key file error you're getting is on a temporary table or a table being rebuilt. You might check your processlist to see if you have some very large query running that is trying to do a create temporary table select * from something;

Since it is a /tmp table, it should be removed when the thread that created it terminates. When the logs pop up, is it the same filename? or a different filename? Is it possible that /tmp is not set chmod 1777 ? or are there files there that mysql created that don't have the correct uid:gid?

Related Topic