MySQL Can’t Open File (again)

I had another issue with MySQL not being able to open a file again. Same fix did it.

#1016 - Can't open file: 'wp_bad_behavior_log.MYI' (errno: 145) 

# myisamchk wp_bad_behavior_log.MYI
Checking MyISAM file: wp_bad_behavior_log.MYI
Data records:     109   Deleted blocks:     270
myisamchk: warning: Table is marked as crashed
myisamchk: warning: 4 clients are using or haven't closed the table properly
- check file-size
- check record delete-chain
myisamchk: error: Record at pos: 203284 is not remove-marked
myisamchk: error: record delete-link-chain corrupted
- check key delete-chain
- check index reference
- check data record references index: 1
myisamchk: warning: Auto-increment value: 19908 is smaller than max used value: 19909
- check record links
myisamchk: error: Record-count is not ok; is 113          Should be: 109
myisamchk: warning: Found 235456 deleted space.   Should be 236988
myisamchk: warning: Found        419 parts                Should be: 414 parts
MyISAM-table 'wp_bad_behavior_log.MYI' is corrupted
Fix it using switch "-r" or "-o"

# myisamchk -r wp_bad_behavior_log.MYI
- recovering (with sort) MyISAM-table 'wp_bad_behavior_log.MYI'
Data records: 109
- Fixing index 1
Data records: 113

I wonder what causes the data to be corrupted…

Leave a Comment