myisamchk: error: myisam_sort_buffer_size is too small解决办法

用myisamchk修复一个被损坏的表,结果显示如下错误:

root@10-10-74-251:/data/mysql_data/cmd5# myisamchk -r -f md5_core.MYI
– recovering (with sort) MyISAM-table ‘md5_core.MYI’
Data records: 0
– Fixing index 1
myisamchk: error: myisam_sort_buffer_size is too small
MyISAM-table ‘md5_core.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是没有myisam_sort_buffer_size的,只有sort_buffer_size,估计是sort_buffer_size不足,我的索引MYI文件很大,所以干脆设置–sort_buffer_size=16M 。其他参数也设置一下吧,反正不超过内存大小就可以。执行如下命令进行sort_buffer_size设置并且修复表:

myisamchk -r -f md5_core.MYI –sort_buffer_size=16M –key_buffer_size=32M –read_buffer_size=20M –write_buffer_size=20M


                   


                   

来自  http://www.piikee.net/1211.html