After a recent server migration, I found that my MySQL instance was not starting up (on Debian Squeeze). A look in the logs revealed that MySQL was having issues with corrupt InnoDB tables and therefore refusing to start. A number of forums informed me to do the following.
- Open (in my case)
/etc/mysql/my.cnf
in an editor. - Add the following line within the
[mysqld]
section (which should also have a comment noting it as the Basic Settings section.
innodb_force_recovery = 1
- Save the file and exit the editor.
- Restart MySQL.
- Use mysqldump to take a complete database dump.
- Comment out the
innodb_force_recovery
switch inmy.cnf
(by prefixing the line with a#
. - Save the file again.
- Restart MySQL.
This, according to the forum, should fix the corruption error. Apparently, simply dumping the jury-rigged database is enough to clean it up. This, however, did not happen in my case.
I did however get mine back up and running with:
innodb_force_recovery = 4
Unfortunately, dumping the database after this did not fix my tables. I apparently need to delete the InnoDB databases, and the data and log files, and subsequently restore my databases from backups. I will tackle this in a different post once I get it working. FWIW, the error message I'm seeing in the logs hints at something like the following:
Innodb log sequence number is in the future.
- Log in to post comments