Mysql error in backup

Was just reviewing my backup log and noticed the following error…

data: mysqldump: Couldn't execute 'show create tablecel': Table './asteriskcdrdb/cel' is marked as crashed and should be repaired (145)

so I tried…

[[email protected] ~]# mysql -b -u root -D asteriskcdrdb -e "REPAIR TABLE cdr" -u root
| Table             | Op     | Msg_type | Msg_text |
| asteriskcdrdb.cdr | repair | status   | OK       |
[[email protected] ~]# mysqlcheck -u root --check asteriskcdrdb                       asteriskcdrdb.cdr                                  OK
warning  : Table is marked as crashed
warning  : 3 clients are using or havent closed the table properly
error    : Size of datafile is: 321835008         Should be: 321835120
error    : Corrupt

Did I miss something doing the repair that it’s still showing corrupt?


Your repaired cdr. But CEL is corrupt.

Just noticed that about 2 seconds after I posted :slight_smile: That’s what I get for missing the coffee on the way to work.


1 Like

A possible source of this error is trying to back up the data files from the MySQL data directory without “quiescing” your database. Basically, you have to at least “pause and flush” the database engine before you can copy the data files from MySQL (or MariaDB…).