[Howto Fix] Table './eximstats/sends' is marked as crashed and should be repaired

Submitted by rex on Fri, 04/30/2010 - 17:16

I've tryed to dump my whole databases with mysqldump

mysqldump --all-databases > all_databases.sql

got the error 'Table './eximstats/sends' is marked as crashed and should be repaired when using LOCK TABLES'

'eximstats' is my databasename und 'sends' my tablename.

I've tryed to repair the table with

mysqlcheck -u root --check auto-repair --optimize all-databases

but it no not worked

I've also tryed to repair ith with

mysql> repair table eximstats.sends;
+-----------------+--------+----------+-----------------------------------------------------------------------+
| Table           | Op     | Msg_type | Msg_text                                                              |
+-----------------+--------+----------+-----------------------------------------------------------------------+
| eximstats.sends | repair | Error    | Table './eximstats/sends' is marked as crashed and should be repaired |
| eximstats.sends | repair | Error    | Table 'sends' is marked as crashed and should be repaired             |
| eximstats.sends | repair | status   | Table is already up to date                                           |
+-----------------+--------+----------+-----------------------------------------------------------------------+

and it do not worked again...

I've stoped mysql daemon

service mysqld stop

I've tryed to repair MYI files with myisamchk with the parameter '-r'.

root@server[/home/user]# myisamchk /var/lib/mysql/eximstats/sends.MYI
Checking MyISAM file: /var/lib/mysql/eximstats/sends.MYI
Data records:     904   Deleted blocks:  114296
myisamchk: warning: Table is marked as crashed
myisamchk: warning: 19 clients are using or haven't closed the table properly
- check file-size
- check record delete-chain
myisamchk: error: record delete-link-chain corrupted
- check key delete-chain
- check index reference
- check data record references index: 1
myisamchk: error: Found key at page 3105792 that points to record outside datafile
MyISAM-table '/var/lib/mysql/eximstats/sends.MYI' is corrupted
Fix it using switch "-r" or "-o"
root@server[/home/user]# myisamchk /var/lib/mysql/eximstats/sends.MYI -r
- recovering (with sort) MyISAM-table '/var/lib/mysql/eximstats/sends.MYI'
Data records: 904
- Fixing index 1
- Fixing index 2
- Fixing index 3

And it worked suddenly :)

Add new comment