Table "表名" is marked as crashed and should be repaired
Caused by: java.sql.SQLException: Table '表名' is marked as crashed and should be repaired
原因是表的索引文件发生错误,当时直接重启服务器的时候刚好还有程序正往表里面添加数据。
windows 操作系统下,进入数据库存放的表路径下
例如:
D:\mysql6\data\cpc>myisamchk -c -r -f 表名
linux下
到mysql的安装目录的bin/myisamchk工具,在命令行中输入:
myisamchk -c -r ../data/表名.MYI
如果还不行,就-f 强制修复