Repairing the MySQL WordPress Database

You can recover a running MySQL database with the mysqlcheck command.

After a power cut, I found these errors in /var/log/daemon.log. This was on Debian Squeeze running WordPress 3.3.1 and MySQL 5.1.61.

Mar 22 11:22:16 debian /etc/mysql/debian-start[2153]: Triggering myisam-recover for all MyISAM tables
Mar 22 11:22:17 debian mysqld: 120322 11:22:17 [ERROR] /usr/sbin/mysqld: Table './wordpress/wp_commentmeta' is marked as crashed and should be repaired
Continue reading