如上錯誤的解決方法如下:
1、進入數據庫對該表進行檢測:
mysql> check tables ofoffline;
+-------------------------+-------+----------+-------------------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-------------------------+-------+----------+-------------------------------------------------------+
| jxzhtopenfire.ofoffline | check | warning | Table is marked as crashed |
| jxzhtopenfire.ofoffline | check | warning | 1 client is using or hasn't closed the table properly |
| jxzhtopenfire.ofoffline | check | error | Record at pos: 1175720 is not remove-marked |
| jxzhtopenfire.ofoffline | check | error | record delete-link-chain corrupted |
| jxzhtopenfire.ofoffline | check | error | Corrupt |
+-------------------------+-------+----------+-------------------------------------------------------+
5 rows in set
2、使用repair解決方法:
mysql> repair table ofoffline;
+-------------------------+--------+----------+------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-------------------------+--------+----------+------------------------------------------+
| jxzhtopenfire.ofoffline | repair | warning | Number of rows changed from 2349 to 2451 |
| jxzhtopenfire.ofoffline | repair | status | OK |
+-------------------------+--------+----------+------------------------------------------+
再次進行dump備份就可以了。
備份mysql數據庫時報錯:mysqldump: Got error: 145: Table './jxzhtopenfire/ofoffline' is marked as crashed and should be repaired when using LOCK TABLES。
這樣的錯誤。
mysqldump -u root -pMyPassword DbName --lock-tables=false > data.sql