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

I noticed that one of my servers was running out of disk space, due to heavy MySQL usage. I stopped everything using the database, freed up some space and restarted mysqld.

Now, I checked my table with CHECK TABLE table and it gave me this:

| Table             | Op    | Msg_type | Msg_text                                                      |
| db.table | check | warning  | Table is marked as crashed and last repair failed             |
| db.table | check | warning  | 1 client is using or hasn't closed the table properly         |
| db.table | check | warning  | Size of indexfile is: 8656211968      Should be: 1024         |
| db.table | check | error    | Size of datafile is: 3068555264         Should be: 3068558490 |
| db.table | check | error    | Corrupt                                                       |

How can I fix that? Simply running "REPAIR TABLE" does not work, I tried that and it never finished (killed it after 18 hours). How can I save the data?

share|improve this question

Your table(s) have crashed. This happens with non-transactional databases such as MyISAM. Consider a move to InnoDB if you don't need fulltext search.

Anways - you have to repair it, there is no way around. Try the following in a shell to repair all your tables:

#myisamchk --force --fast --update-state /path/to/your/database/*.MYI
share|improve this answer
That's only going to work, if there is at least double the disk space of my table. But there isn't. I guess I have to copy the whole database to another machine and then repair it. – s1ck Jan 31 '13 at 13:35
You can just copy the required table files (table_name.*) instead of copying whole database. Due to space your previous attempt was not successfull. – Wasif Feb 1 '13 at 6:36

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.