數據庫Table xxx is marked as crashed and should be repaired錯誤的解決方法服務器斷電等原因可能導致數據表損壞,導致訪問的時候提示:Table xxx is marked as crashed and should be repaired其中xxx為表的名稱。
找到對應的表,使用 repair table table_name; 進行修復
mysql> select * from log_check_user; ERROR 1194 (HY000): Table 'log_check_user' is marked as crashed and should be repaired mysql> repair table log_check_user; +----------------------+--------+----------+-------------------------------------------------+ | Table | Op | Msg_type | Msg_text | +----------------------+--------+----------+-------------------------------------------------+ | sg456.log_check_user | repair | info | Wrong bytesec: 0- 0- 0 at 68974624; Skipped | | sg456.log_check_user | repair | warning | Number of rows changed from 428999 to 428998 | | sg456.log_check_user | repair | status | OK | +----------------------+--------+----------+-------------------------------------------------+ 3 rows in set (24.87 sec) mysql> select * from log_check_user;