mysqldump 提示 Got error: 145
最近在使用 mysqldump 备份mysql数据库的过程中,出现了错误,执行不下去。
错误提示如下:
mysqldump: Got error: 145: Table ‘supe_cache’ is marked as crashed and should be repaired when using LOCK TABLES
在网上查了下,可能是由于不正常的关闭数据库导致Myisam类型的表损坏。
解决方法比较简单,即使用check table命令和repair table命令,执行如下:
mysql> check table supe_cache;
+———————–+——-+———-+—————————————————————————–+
| Table | Op | Msg_type | Msg_text |
+———————–+——-+———-+—————————————————————————–+
| test.supe_cache| check | error | Table ‘supe_cache’ is marked as crashed and should be repaired |
+———————–+——-+———-+—————————————————————————–+
1 row in set (0.00 sec)
mysql> repair table supe_cache;
+———————–+——–+———-+————————————–+
| Table | Op | Msg_type | Msg_text |
+———————–+——–+———-+————————————–+
| test.supe_cache | repair | warning | Number of rows changed from 13 to 14 |
| test.supe_cache | repair | status | OK |
当然也可以在phpMyAdmin里面选择修复表supe_cache。
