解决方法:
进入/usr/bin下,执行命令
zx@zx-Lenovo-Product:/usr/bin$ ./myisamchk -c -r /var/lib/mysql/Microblog/PL2F_1_ftb_mb026.MYI(数据库表名的完整路径)
可能会提示如下错误:
- recovering (with sort) MyISAM-table '/var/lib/mysql/Microblog/PL2F_1_ftb_mb026.MYI'
Data records: 193511
- Fixing index 1
Found link that points at 74158072 (outside data file) at 3294092
- Fixing index 2
- Fixing index 3
./myisamchk: Can't change permissions of the file '/var/lib/mysql/Microblog/PL2F_1_ftb_mb026.MYD' (Errcode: 1)
myisamchk: error: 1 when fixing table
MyISAM-table '/var/lib/mysql/Microblog/PL2F_1_ftb_mb026.MYI' is not fixed because of errors
Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag
zx@zx-Lenovo-Product:/usr/bin$ ./myisamchk -c -r -f -o /var/lib/mysql/Microblog/PL2F_1_ftb_mb026.MYI
- recovering (with keycache) MyISAM-table '/var/lib/mysql/Microblog/PL2F_1_ftb_mb026.MYI'
Data records: 193511
Found link that points at 74158072 (outside data file) at 3294092
./myisamchk: Can't change permissions of the file '/var/lib/mysql/Microblog/PL2F_1_ftb_mb026.MYD' (Errcode: 1)
myisamchk: error: 1 for record at pos 73838964
MyISAM-table '/var/lib/mysql/Microblog/PL2F_1_ftb_mb026.MYI' is not fixed because of errors
Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag
解决方法:(注意简单使用chmod来改变表的权限是不起作用的)
运行如下命令:
zx@zx-Lenovo-Product:/usr/bin$ sudo ./myisamchk -c -r /var/lib/mysql/Microblog/PL2F_1_ftb_mb026.MYI(数据库表名的完整路径)