mysql解决Table ‘./xxx/xxxxxx’ is marked as crashed and should be repaired 错误

版权声明:文章来源:良玉的博客 http://www.uouo123.com/ 转载请注明 https://blog.csdn.net/xiangliangyu2008/article/details/82703170

mysql解决Table ‘./xxx/xxxxxx’ is marked as crashed and should be repaired 错误

然后进入 MySQL 数据库发现 Table ‘./xxx/xxxxxx’ is marked as crashed and should be repaired 错误,因为 xxxxxx表被损坏了,所以 WordPress 的文章都显示不出来:

mysql -u root -p
Enter password:

mysql> use xxx;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from xxxxxx;
ERROR 145 (HY000): Table './xxx/xxxxxx' is marked as crashed and should be repaired
mysql> Bye

修复 MySQL 数据库数据表问题可以由 mysqlcheck 来解决,先用 mysqlcheck 查看一下:

# mysqlcheck -u root -p xxx
Enter password:

然后添加 –auto-repair 参数自动修复,最好修复前备份一下数据库:

# mysqldump -u root -p xxx> xxx.sql
Enter password:

# mysqlcheck -u root -p xxx--auto-repair
Enter password:
xxx.xxxxxx
error    : Table upgrade required. Please do "REPAIR TABLE `xxxxxx`" or dump/reload to fix it!

Repairing tables
xxx.xxxxxx    OK

猜你喜欢

转载自blog.csdn.net/xiangliangyu2008/article/details/82703170