Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I am getting the error:

Table 'feed_data' is marked as crashed and should be repaired

So I run REPAIR TABLE feed_data (repeatedly) and get the following result:

+----------------+--------+----------+---------------------------------------------------------------+
| Table          | Op     | Msg_type | Msg_text                                                      |
+----------------+--------+----------+---------------------------------------------------------------+
| mydb.feed_data | repair | Error    | Table 'feed_data' is marked as crashed and should be repaired | 
| mydb.feed_data | repair | status   | Table is already up to date                                   | 
+----------------+--------+----------+---------------------------------------------------------------+
2 rows in set (0.06 sec)

The table still shows as crashed. Why won't the table repair when I run the repair table command? What else can I do to repair the crashed table?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Shutdown the DB and use myisamchk.

share|improve this answer
    
I once had to export that data, the rebuild the table and reimport the data because myisamchk didn't work. –  lilott8 Mar 4 '11 at 18:02

You may also want to have mysql perform automatic repairs each time you restart mysql

Just add this to the [mysqld] section of /etc/my.cnf

myisam-recover=<\option[,option]*>

Here is a more detailed explanation of the options as explained in the book

enter image description here

MySQL 5.0 Certification Study Guide Chapter 30 Section 30.5 Pages 444,445

Here are the options for myisam-recover

  • DEFAULT for the default checking

  • BACKUP tells the server to make a backup of any table that it must change

  • FORCE causes table recovery to be performed even if it would cause the loss of more than one row of data

  • QUICK performs quick recovery: Tables that have no holes resulting from deletes or updates are skipped

share|improve this answer

Your Answer

 
discard

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.