MySQL table corrupt & repair

Recently I am trying to dump a customer MySQL database to a SQL file & restore to another server.
An error occur during the dump process.

The error mention that one of the table in the database is crashed & repair required.
Then I try to login into MySQL server & use the particular database & execute the “DESC” command.
The result is “ERROR 145 (HY000): Table ‘./XXXXXXX/tracker’ is marked as crashed and should be repaired”

mysql> desc tracker;
ERROR 145 (HY000): Table './XXXXXXX/tracker' is marked as crashed and should be repaired
mysql> check table tracker;
+----------------------+-------+----------+----------------------------------------------------------------------------+
| Table                | Op    | Msg_type | Msg_text                                                                   |
+----------------------+-------+----------+----------------------------------------------------------------------------+
| XXXXXXX.tracker      | check | error    | Table './XXXXXXXXX/tracker' is marked as crashed and should be repaired |
+----------------------+-------+----------+----------------------------------------------------------------------------+
1 row in set (0.03 sec)

Then I try to execute the repair command for the table & it solve the problem.

mysql> repair table tracker;
+----------------------+--------+----------+------------------------------------------+
| Table                | Op     | Msg_type | Msg_text                                 |
+----------------------+--------+----------+------------------------------------------+
| XXXXXXXXXXXX.tracker | repair | warning  | Number of rows changed from 0 to 1151697 |
| XXXXXXXXXXXX.tracker | repair | status   | OK                                       |
+----------------------+--------+----------+------------------------------------------+
2 rows in set (2 min 7.91 sec)

8 Comments to “MySQL table corrupt & repair”

  1. repair MySQL 19 March 2009 at 5:26 pm #

    That’s good that it recover your database, but some times this kind of corrections in MySQL doesn’t able to repair corrupted MySQL database files, then MySQL repair software is required.

  2. David 29 June 2009 at 3:10 pm #

    Sometime the repair query doesn’t repair the database. During that time you need to use MySQL recovery Software.

  3. Kumar Keswani 16 September 2009 at 2:36 am #

    Thanks! it worked fine.

  4. SugarUser 8 March 2010 at 1:07 pm #

    I am novice command line user (couldn’t USE DB, wrong permissions were setup etc) However, I used the repair SQL code, in PhpMyAdmin – and it has worked perfectly, thanks.

  5. Helaine Slisz 28 October 2011 at 7:33 am #

    Amazing perform! Keep posting excellent materials.

  6. Sofia 27 November 2011 at 12:50 pm #

    Fine tips! I have been previously searching for something like this for quite a while now. Appreciate it!

  7. Farouk 12 January 2012 at 1:48 am #

    repair table worked for me like a charm. Thank you!

  8. roulette 18 April 2012 at 4:00 pm #

    “Great, thanks for sharing this article post.Really thank you! Really Cool.”


Leave a Reply