'./fos_op2/t_op_file_log' is marked as crashed and should be repaired

问题遇到的现象和发生背景

查询数据表报错 SQL Error [145] [HY000]: Table './fos_op2/t_op_file_log' is marked as crashed and should be repaired
mysqlcheck -h 11.11.11.11 -u appuser -p fos_op2
Enter password: 111111111
fos_op2.t_api_log OK
fos_op2.t_app OK
fos_op2.t_bucket OK
fos_op2.t_dict OK
fos_op2.t_log OK
fos_op2.t_op_file_info OK
fos_op2.t_op_file_log
warning : Table is marked as crashed
warning : 1 client is using or hasn't closed the table properly
error : Record at pos: 127678032 is not remove-marked
error : record delete-link-chain corrupted
error : Corrupt
fos_op2.t_role OK
fos_op2.t_secret_key OK
fos_op2.t_user OK
fos_op2.t_user_role OK
fos_op2.t_uuid_map OK

1、首先进入mysql命令台:

mysql -u root -p 回车 输入密码

2、查询所有的库

mysql> show databases;

3、进入数据库“eduyun_2015_sp1”是库名, 这里改成你的数据库名

mysql> use eduyun_2015_sp1;

4、check table newabout(newabout--出现错误的表)用来检查出现问题的表的状态,出现错误就正常

5、然后用repair table newabout

6、再用check table newabout 检查一下就ok了

https://blog.csdn.net/weixin_29149259/article/details/113112866

按照这个博客修复了

mysql> check table t_op_file_log;
+-----------------------+-------+----------+-------------------------------------------------------+
| Table                 | Op    | Msg_type | Msg_text                                              |
+-----------------------+-------+----------+-------------------------------------------------------+
| fos_op2.t_op_file_log | check | warning  | Table is marked as crashed                            |
| fos_op2.t_op_file_log | check | warning  | 1 client is using or hasn't closed the table properly |
| fos_op2.t_op_file_log | check | error    | Record at pos: 127678032 is not remove-marked         |
| fos_op2.t_op_file_log | check | error    | record delete-link-chain corrupted                    |
| fos_op2.t_op_file_log | check | error    | Corrupt                                               |
+-----------------------+-------+----------+-------------------------------------------------------+
5 rows in set (0.05 sec)

mysql> repair table t_op_file_log;
+-----------------------+--------+----------+----------+
| Table                 | Op     | Msg_type | Msg_text |
+-----------------------+--------+----------+----------+
| fos_op2.t_op_file_log | repair | status   | OK       |
+-----------------------+--------+----------+----------+
1 row in set (1.27 sec)