2013年10月9日,早上extmail管理員有mail收到錯誤日誌
原因是mysql的dspam數據庫中的dspam_token_data表有錯誤,需要使用myisamchk 進行修復:
# cd /var/lib/mysql/dspam
# myisamchk dspam_token_data.MYI //檢查dspam_token_data表
# myisamchk -r dspam_token_data.MYI //修復dspam_token_data表(-r)可以解決幾乎所有問題
注:修復表的選項開關有很多 (-o)安全方式(-f)強制方式(-q)快速方式(錯誤嚴重時不能用)
實際操作時用了多種選項開關或組合,最後修復成功的記錄顯示如下:
[root@mail dspam]# myisamchk -f dspam_token_data.MYI
Checking MyISAM file: dspam_token_data.MYI
Data records: 14326778 Deleted blocks: 907003
myisamchk: warning: Table is marked as crashed and last repair failed
- check file-size
myisamchk: warning: Size of indexfile is: 300661760 Should be: 108279808
- check record delete-chain
myisamchk: warning: Found 0 deleted space in delete link chain. Should be19954066
myisamchk: error: Found 0 deleted rows in delete link chain. Should be 907003
myisamchk: error: record delete-link-chain corrupted
- recovering (with sort) MyISAM-table 'dspam_token_data.MYI'
Data records: 14326778
- Fixing index 1
myisamchk: warning: Duplicate key for record at 315149384 againstrecord at 959552
Data records: 14326777
myisamchk: warning: 1 records have been removed