[mysql_stmt_error]: Table 'XXXXXX表' is marked as crashed and should be repaired [mysql_stmt_errno]: 145 [mysql_stmt_sqlstate]: HY000 [
程序突然挂掉,看日志连不上数据库,发现mysql挂掉了,重启了一下mysql,然后程序打印日志
Connect Mysql error[MySQL: [MySQL]: [Comment]: mysql_stmt_prepare error [mysql_stmt_error]: Table 'XXXX库.XXXXXX表' is marked as crashed and should be repaired [mysql_stmt_errno]: 145 [mysql_stmt_sqlstate]: HY000
解决办法
1.登陆mysql后台
mysql -u root -p 回车 输入密码
2.进入异常的库
mysql> use testdb;
3.check table t1(t1就是出现错误的表)用来检查出现问题的表的状态,出现错误就正常
mysql> check table t1;
执行结果不方便截图
4.
mysql> repair table t1
5.再用check table t1 检查一下