mysql数据库备份报错145_mysql数据库导出时报错mysqldump: Got error: 145的解决方法
在給mysql數據庫備份時,報錯:mysqldump: Got error: 145: Table './jxzhtopenfire/ofoffline' is marked as crashed and should be repaired when using LOCK TABLES。
如上錯誤的解決方法如下:
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的時候加上--lock-tables=false就可以解決問題。
mysqldump -u root -pMyPassword DbName --lock-tables=false > data.sql
總結
以上是生活随笔為你收集整理的mysql数据库备份报错145_mysql数据库导出时报错mysqldump: Got error: 145的解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: pythonjoin函数所在包_Pyth
- 下一篇: mac安装mysql修改密码_Mac下安