Knowledges
Search our knowledgebase, watch videos and find answers.

Problem

Sometimes after the MySQL restart you get this message:

150812 16:40:36 [ERROR] mysqld: Table './xxx_www/wp_options' is marked as crashed and should be repaired
150812 16:40:18 [ERROR] mysqld: Table './xxx_log/login_track' is marked as crashed and should be repaired

Solution

Log in to your server via SSH as root and type the following command:

mysqlcheck --repair --all-databases

If “mysqlcheck” command returns the following message, you must repair the  tables manually.

note     : The storage engine for the table doesn't support repair

For check only

myisamchk /var/lib/mysql/xxx_www/wp_options

For force recover

myisamchk -f /var/lib/mysql/xxx_www/wp_options

For safe recover

myisamchk --safe-recover /var/lib/mysql/xxx_www/wp_options

Overwrite /var/lib/mysql/ path with your MySQL tables path and xxx_www/wp_options with the table name.

Don’t know your MySQL tables directory? Try the find command:

find / -type f -name table_name.*

Result

- recovering (with sort) MyISAM-table '/var/lib/mysql/xxx_www/wp_options'
Data records: 305
- Fixing index 1
- Fixing index 2
Join the community

Our sponsors

We’re social

New in Lab

New Collection

New Tutorial

Knowledge base