最近原爲移動mysql 及對mysql進行升級的操做,導至一個很大的數據表不能訪問了。百度,谷歌了很多資料,判斷爲是移動後索引的問題。
但根據以前的修復索引的工作命令。一直沒有成功。把版本降回到原來的版本號升級,也是一樣的情況。
[root@c1 datacenter_crawler]# myisamchk -r -f tb_test_webContent.MYI
- recovering (with sort) MyISAM-table 'tb_test_webContent.MYI'Data records: 0
- Fixing index 1
myisamchk: error: myisam_sort_buffer_size is too small
MyISAM-table 'tb_test_webContent.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
[root@c1 datacenter_crawler]# myisamchk -r -f tb_test_webContent.MYI -r -q
- check record delete-chain
- recovering (with sort) MyISAM-table 'tb_test_webContent.MYI'
Data records: 0
- Fixing index 1
myisamchk: error: myisam_sort_buffer_size is too small
MyISAM-table 'tb_test_webContent.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
[root@c1 datacenter_crawler]# myisamchk -r -f tb_test_webContent.MYI -o -q
- check record delete-chain
- recovering (with keycache) MyISAM-table 'tb_test_webContent.MYI'
Data records: 0
Key 1 - Found wrong stored record at 0
MyISAM-table 'tb_test_webContent.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
後通過其它的命令參數。數據庫就成功開始修復了。命令是
myisamchk -r -f tb_test_webContent.MYI -o -q
myisamchk具體參數大意,後面補充。