打印本文 打印本文 关闭窗口 关闭窗口
解决Table xxx is marked as crashed and should be repaired
作者:佚名  文章来源:本站原创  点击数2936  更新时间:2012/9/16 10:05:18  文章录入:mintao  责任编辑:mintao
解决Table xxx is marked as crashed and should be repaired wordpress显示无法链接数据库,在服务器上测试mysql -uxxxx -p能登陆,遂检查mysql的error日志发现如下信息:

120204 15:54:22 [ERROR] /usr/sbin/mysqld: Table './zq9n4kty38/wp_options' is marked as crashed and should be repaired
120204 15:54:26 [ERROR] /usr/sbin/mysqld: Table './zq9n4kty38/wp_options' is marked as crashed and should be repaired
120204 15:54:26 [ERROR] /usr/sbin/mysqld: Table './zq9n4kty38/wp_options' is marked as crashed and should be repaired
120204 15:54:26 [ERROR] /usr/sbin/mysqld: Table './zq9n4kty38/wp_options' is marked as crashed and should be repaired

以上信息表明zq9n4kty38库的wp_options表已崩溃,需要修复。找到对应的MYI文件,然后执行myisamchk -c -r /path/to/zq9n4kty38/wp_options.MY:

- recovering (with sort) MyISAM-table 'wp_options.MYI'
Data records: 243
- Fixing index 1
Found block with too small length at 9956; Skipped
Found block that points outside data file at 10792
- Fixing index 2
Data records: 239

提示如上,修复后即可正常访问。
 
另,不会使用MYSQL命令的朋友可以直接登陆phpMyadmin进行修复,然后优化一下即可解决问题,如果您实在解决不了类似问题,您可以联系http://blog.mintao.net/我解决。
打印本文 打印本文 关闭窗口 关闭窗口