June 18, 2009

MySQL Table Is Marked As Crashed and Should Be Repaired

I was greeted by the following error this evening from within my SugarCRM instance:

MySQL error 1194: Table 'contacts' is marked as crashed and should be repaired

So this is what I did to fix it:

[root@crm ~]# mysql -p
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.

mysql> use sugarcrm
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> CHECK TABLE contacts;
+-------------------+-------+----------+-----------------------------+
| Table             | Op    | Msg_type | Msg_text                    |
+-------------------+-------+----------+-----------------------------+
| sugarcrm.contacts | check | error    | Found wrong record at 73544 |
| sugarcrm.contacts | check | error    | Corrupt                     |
+-------------------+-------+----------+-----------------------------+
2 rows in set (0.18 sec)

mysql> REPAIR TABLE contacts;
+-------------------+--------+----------+-----------------------------------------------------+
| Table             | Op     | Msg_type | Msg_text                                            |
+-------------------+--------+----------+-----------------------------------------------------+
| sugarcrm.contacts | repair | info     | Key 1 - Found wrong stored record at 73544          |
| sugarcrm.contacts | repair | info     | Found block with too small length at 78096; Skipped |
| sugarcrm.contacts | repair | warning  | Number of rows changed from 892 to 877              |
| sugarcrm.contacts | repair | status   | OK                                                  |
+-------------------+--------+----------+-----------------------------------------------------+
4 rows in set (0.26 sec)

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.