先停止mysql: sudo service mysql stop
进入指定异常文件的目录./commerce_sit/pgrels
/var/lib/mysql/commerce_sit#
执行命令
sudo myisamchk --safe-recover -f -r pgrels
如果有报以下报错:
myisamchk: error: myisam_sort_buffer_size is too small
MyISAM-table 'pgrels' 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
用下面执行
sudo myisamchk --safe-recover -f -r pgrels --sort_buffer_size=160M --key_buffer_size=160M --read_buffer_size=20M --write_buffer_size=20M
成功后:
Data records: 0
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5
- Fixing index 6
Data records: 23419642