Incorrect key file Mysql error

Posted on

Incorrect key file Mysql error – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, mysql, , , .

An interesting mysql error has popped up on an ExpressionEngine site I’m running recently. When trying to access the admin control panel I get the following mysql error:

Error Number: 126

Incorrect key file for table '/tmp/#sql_XXX_XX.MYI'; try to repair it

It’s a VPS and I have root access. Confusingly, there appears not to be any such file in the /tmp/ directory. A bit of googling has shown me that it could be an issue with space on this partition but the tmp folder is almost empty (only a few k) and I’m at a bit of a loss as to what to do next. Repairing said table also yielded no joy.

Solution :

To sort this out I changed the location of the mysql tmp directory in /etc/mysql/my.cnf then restarted mysql. All is now well.

That table can be deleted. It is a temporary table and it is probably very old by now (a minutes old). /tmp was proabably full at the time the table was being made, especially if other apps were writing to /tmp as well.

Look into having your hosting provider setup another disk within the VPS and then configure MySQL’s tmpdir variable to point to that new disk.

Leave a Reply

Your email address will not be published.