Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer
Please come back in a few days and mark this answer as the solution :) – pauska Dec 2 '11 at 12:21

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.

share|improve this answer
Thanks for the swift response, I ended up moving the tmp dir and restarting mysql which seems to have sorted things out. – chambers Dec 2 '11 at 9:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.