Are you seeing error messages like?

mysqldump: Got error: 144: "Table is marked as crashed and last (automatic?) repair failed" when using LOCK TABLES

Okay let's try the easy solution:

Log into MySQL:

mysql -uroot -p DB_NAME

Issue the repair command:


Be sure to replace DB_NAME and TABLE_NAME with your details. If it success, it's your day.

Still not working? MySQL repair command failing? Okay let's try a bit more advanced solution.

Find MySQL installation directory in your FS. Hint: It's in /var/lib/mysql/ for Debian and CentOS.

Run myisamchk for your table now:

myisamchk -r /var/lib/mysql/DB_NAME/TABLE_NAME

If it doesn't work, try forcing it:

myisamchk -rf /var/lib/mysql/DB_NAME/TABLE_NAME

Still out of luck?

Okay let's try final Goddammit solution. Delete the crashing file first:

rm /var/lib/mysql/DB_NAME/TABLE_NAME.TMD

Now try repair

myisamchk -r /var/lib/mysql/DB_NAME/TABLE_NAME

Hope it's good now!

What's on your mind?