Tag Archives: InnoDB: You can try to recover the database with the my.cnf

MySQL server not starting – Part 2

There are ton’s of causes for which MySQL might not start, ranging from disk space full ( highlighted here ) to databases getting corrupt.

First place where you have to check for a clue is the .err log
– ( /var/lib/mysql/hostname.err )

If the err corresponds to something like this :

InnoDB: Page lsn 0 40542, low 4 bytes of lsn at page end 40542
InnoDB: Page number (if stored to page already) 47,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored
InnoDB: Page may be an update undo log page
InnoDB: Page may be an index page where index id is 12
InnoDB: Also the page in the doublewrite buffer is corrupt.
InnoDB: Cannot continue operation.
InnoDB: You can try to recover the database with the my.cnf
InnoDB: innodb_force_recovery=X

One of the reason for this error is the use of multiple storage engines, MyISAM or InnoDB

Check your /etc/my.cnf for any lines which highlight the use
of multiple storage engines.

Following can be an example :

innodb_force_recovery=X
default-storage-engine=MyISAM

The above configuration implies MyISAM is the default storage engine, but another setting related to innoDB is already given, which conflicts.

If your default storage engine is MyISAM, then giving the following option in /etc/my.cnf would fix the issue :

skip-innodb

Once the configuration file is edited, restart the service to save the changes

Note : Mostly applies to MySQL versions < 5.5.x