执行查询报: Incorrect key file for table ‘test’; try to repair it

时间:2023-03-08 16:54:42
执行查询报: Incorrect key file for table ‘test’; try to repair it

报错信息如下:程序没有错误,但执行会报错,错误定在执行语句上

查了一下资料

执行查询报: Incorrect key file for table ‘test’; try to repair it

网上的解决办法,亲试可用:

mysql> use news;
Database changed
mysql> repair table news_detail;
+------------------+--------+----------+----------+
| Table            | Op     | Msg_type | Msg_text |
+------------------+--------+----------+----------+
| news.news_detail | repair | status   | OK       |
+------------------+--------+----------+----------+
1 row in set (0.37 sec)

mysql> repair table news_category;
+--------------------+--------+----------+----------+
| Table              | Op     | Msg_type | Msg_text |
+--------------------+--------+----------+----------+
| news.news_category | repair | status   | OK       |
+--------------------+--------+----------+----------+
1 row in set (0.02 sec)