Table ‘xxx’ is marked as crashed and should be repaired

13 年 ago jony Table ‘xxx’ is marked as crashed and should be repaired已关闭评论

表被锁住提示上面的。

对表进行修复

在linux下:

shell#/opt/lampp/bin/myisamchk            找到myisamchk所在目录,以及被锁的表名,运行如下命令

#/opt/lampp/bin/myisamchk -c -r /opt/lampp/var/mysql/moyea_product/moyea_promotion

说明:

/opt/lampp/var/mysql/moyea_product/moyea_promotion   这是数据库表名的路径

/opt/lampp/bin/myisamchk     myisamchk命令所以目录

运行结果如下:

[root@cd ~]# /opt/lampp/bin/myisamchk -c -r /opt/lampp/var/mysql/moyea_product/moyea_promotion
- recovering (with sort) MyISAM-table '/opt/lampp/var/mysql/moyea_product/moyea_promotion'
Data records: 1717733
- Fixing index 1
Key 1 - Found wrong stored record at 694058596
Wrong bytesec: 0- 0- 0 at 724381696; Skipped
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5
- Fixing index 6
Data records: 1717736

说明已经修复完成

 

参考:http://www.jb51.net/article/17704.htm