在給mysql數(shù)據(jù)庫備份時(shí),報(bào)錯(cuò):mysqldump: Got error: 145: Table './jxzhtopenfire/ofoffline' is marked as crashed and should be repaired when using LOCK TABLES。
如上錯(cuò)誤的解決方法如下:
1、進(jìn)入數(shù)據(jù)庫對該表進(jìn)行檢測:
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 |
+-------------------------+--------+----------+------------------------------------------+
再次進(jìn)行dump備份就可以了。
備份mysql數(shù)據(jù)庫時(shí)報(bào)錯(cuò):mysqldump: Got error: 145: Table './jxzhtopenfire/ofoffline' is marked as crashed and should be repaired when using LOCK TABLES。
這樣的錯(cuò)誤。
搜索了一下,發(fā)現(xiàn)只要在mysqldump的時(shí)候加上--lock-tables=false就可以解決問題。
mysqldump -u root -pMyPassword DbName --lock-tables=false > data.sql
posted on 2015-09-30 09:56
Glorin 閱讀(2044)
評論(0) 編輯 收藏