Friday, June 20, 2014

mysql database table crash and recovery

There was a power outage yesterday at the studio, and the UPS also tripped. PB reports:
The phplist mailist list server gave the error message

> Message:
> Database error 144 while doing query Table './path/to/tablename' is marked as crashed and last (automatic?) repair failed
>
>
> Currently running the repair on the table tablename​ as suggested here:
>
http://stackoverflow.com/questions/8843776/mysql-table-is-marked-as-crashed-and-last-automatic-repair-failed
>
> cd /var/lib/mysql/path/to/relevant/db
> myisamchk -r tablename.MYI
>
> ​looks like its going to take a long time.....​


and later,

Recovery successful.

​This was done by stopping mysql database:


service mysql stop
myisamchk -r tablename.MYI

- recovering (with sort) MyISAM-table 'tablename.MYI'
Data records: 0
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
Data records: 119477877


service mysql start


No comments:

Post a Comment