This page looks best with JavaScript enabled

Mysql repair innodb!

 ·   ·  ☕ 3 min read

For Mysql database Innodb is the new storage engine used nowadays. Storage engines are the engines used to store and retrieve data. Innodb offers good built-in recovery and solid data reliability. Innodb is transaction safe, and is been used by the number of websites. This very storage engine has many advancements over the other storage engines which are as follows-

1. Innodb provides foreign key support.

2. Innodb is little bit similar to PostgreSql. It also allows successfully execution of blocks of code by the server.

3. Innodb provides consistency, durability compliant transaction support, atomicity, which allows all the transaction to proceed reliably.

Innodb is a product of Oracle which has many features like-

• As database sizes grow Innodb offers greater perceived reliability and availability.

• In some situation Innodb is substantially faster in comparison to MyISAM.

If Innodb crashes and the built in recovery mechanism is unable to roll back the transactions then your database will not start. In ISAM you can start the database even if the table is gets corrupted. But in case of Innodb it is different Innodb will refuse to start until you restore your database from backup.

The key to safe the database management is to take regular backups. At the time you take binary backup of your database it’s a good idea to take the dump of your tables at the same time. You will have to shut out all clients from your database to get a consistent snapshot of all your tables in to your dumps.

If your database gets corrupted or your disks fail then you will have to do the recovery from a backup. To be able to recover and repair Mysql database to the present from the binary back up you will have to run your MySQL database with the binlogging of MySQL switch on. To recover from crash of your MySQL server process, the only thing you have to do is restart it. Innodb will automatically roll-forward the database and check the logs. Innodb will roll back uncommitted transaction which was present at the time of crash.

If you are running Mysql with Innodb tables and you’ve got a crappy hardware, kernel bug, driver bug, accidentally power failure or some rare Mysql bugs and some pages in Innodb tablespace got corrupted. So in such cases you Innodb might typically print something like this-

1. InnoDB: Database page corruption on disk or a failed.

2. InnoDB: File read of page 50.

3. InnoDB: Page may be an update undo log page.

4. InnoDB: You may have to recover from a backup.

Share on