解决 MySQL 的 Table is marked as crashed and should be repaired 问题

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

# mysql -u root -p Enter password: mysql> use wordpress; 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 wp_posts; ERROR 145 (HY000): Table ‘./wordpress/wp_posts’ is marked as crashed and should be repaired

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

# mysqlcheck -u root -p wordpress
Enter password:

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

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

# mysqlcheck -u root -p wordpress --auto-repair
Enter password:
wordpress.wp_commentmeta

ok

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/125956.html

(0)
上一篇 2021年8月30日
下一篇 2021年8月30日

相关推荐

发表回复

登录后才能评论