Fix MySQL Error ‘The log sequence number in ibdata files does not match’


The ibdata file serves as system tablespace container while using InnoDB storage engine. These files contain user related data and indexes along with some internal system information. If any of these files get corrupt or damage then the entire database can go inaccessible. Further in this article one possible scenario has been mentioned along with the solution to resolve the issue.

So, let’s consider a scenario where a server running MySQL on InnoDB engine undergoes unexpected power outage and after this when attempt is made to start the MySQL database again, it didn’t start and behaves abruptly. On viewing the log report for this behavior below mentioned entries along with related time stamps and server name is been observed.

"InnoDB:The log sequence number in ibdata files does not match
InnoDB:The log sequence number in the ib_logfiles!
InnoDB: Database was not shut down normally
InnoDB:Starting crash recovery.
InnoDB:Reading tablespace information from the .ibd files...
InnoDB:Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Page directory corruption: supremum not pointed to.
"

The above mentioned error and its symptoms clearly indicates that the table of the MySQL database has occurred due to the last unexpected power failure. More clearly and specifically the ibdata file has gone damaged.

If you encounter following kind of issue, then you need to try one of the following suitable method to resolve the problem effectively –

  • Restore MySQL database using the last available backup.
  • If the backup was incomplete or not available then try to repair the MySQL table using repair command ‘innodb_force_recovery = 4’ But this command may get fail if the corruption extent is high.
  • If the Innodb repair command has failed, then you need to delete the ibdata tablespace and recreate it after shutting down the server. Renaming the ibdata file can help but it may lead to the data loss.
  • So, the only method left to repair corrupt MySQL database is by using third-party tool like MySQL Repair utility which will effectively repair the MySQL database by using the most powerful and effective algorithm.

So, use MySQL Repair software to repair corrupt MySQL database which is easy to use and supports the latest MySQL versions. It is the read-only tool that maintains the data integrity of database and thus works very efficiently.