2007年6月27日星期三

修复MyISAM数据表

一个PHPWind的论坛,登录mysql数据库报错:Didn't find any fields in table 'pw_tmsgs'
这个问题是由于客户端(client)没有正常关闭造成的(看来以后mysql服务死了后不能随便用Kill了,危险啊)
使用 mysiamchk命令修复:
root# /data/app/mysql/bin/myisamchk --recover \
/data/app/mysql/data/bbs/pw_tmsgs.MYI
结果修复报错:
myisamchk: Disk is full writing '/data/app/mysql/data/bbs/pw_tmsgs.TMD' (Errcode: 28)

Google得知:
- make sure you have at least 2 times the amount of free disk space in your mysql data partition as the size of the table you are repairing.

一检查/data目录已经满了,汗,全被bbs的错误日志占满了,清空日志,重新执行命令,顺利通过。Web又访问正常了~
-------------------------------------
几个修复参数:
-r (--recover)
-q (--quick) 快速修复,仅修复索引
-o (--safe-recover)
-f (--force)

阅读全文...