数据库表修复问题

错误提示:

ERROR 1194 (HY000): Table 'test' is marked as crashed and should be repaired。

情况说明:

test表在database manager下创建

解决办法一:

1、检查:mysql> check table test; 会打印一些出错信息

2、执行ps aux |grep mysq 查看mysql运行安装路径,例如本机是/var/lib/mysql

3、进入步骤2中目录,cd manager

4、myisamchk -f test.MYI即可解决。

解决方法二:

先登录到mysql,切换到对应数据库下,然后执行 repair table test;

如果报错,就停掉mysql,cd到mysql这个表的数据文件,即/var/lib/mysql/manager目录下

然后执行: myisamchk --sort_buffer_size=16M --key_buffer_size=16M --read_buffer_size=1M --write_buffer_size=1M -r -f test.MYI

原文地址:https://www.cnblogs.com/pistachio123/p/7809325.html