3

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?

Highway of Life
  • 195
  • 1
  • 2
  • 7

2 Answers2

2

Shutdown the DB and use myisamchk.

Gaius
  • 11,238
  • 3
  • 32
  • 64
1

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

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536