After a disk full issue one of the MySQL DBs on the server is coming up with the following error when I try to back it up:

[root@mybox ~]# mysqldump -p --result-file=/tmp/dbbackup.sql --database myDBname
Enter password:
mysqldump: Got error: 145: Table './myDBname/myTable1' is marked as crashed and should be repaired when using LOCK TABLES

A bit of investigation shows two tables have this issue.

What needs to be done to fix up the damaged tables?

  • myisam table storage? – rkthkr May 3 '10 at 6:53

To check the tables:

CHECK TABLE mytable1

To repair the table:

| improve this answer | |

Here is specifically what always fixes the table for me:

myisamchk -o /var/lib/mysql/YourDB/yourcrashedtable.MYI

Source: http://realtechtalk.com/MySQL_table_is_marked_as_crashed_solultion-1924-articles

| improve this answer | |

Do this.

cd /var/lib/mysql/dbname myisamchk --silent --force *.MYI

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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