InnoDB: Error:MySQL log is in the future! [Solved]

InnoDB: Error: page 570 log sequence number 7289495
InnoDB: is in the future! Current system log sequence number 5574939.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: for more information.

My database is relative small in size so I decided to go with the first two easy recipes. But the “” perl script failed to work because of the mysql root password. I used mysqldump to do the work. Here is what I did:
1) stop mysqld: sudo service mysqld stop
2) backup all the data : mysqldump -u root -p --all-databases > all-databases.sql
3) rename the files in case anything bad happens:
mv ib_logfile0 ib_logfile0.bak
mv ib_logfile1 ib_logfile1.bak
mv ibdata1 ibdata1.bak
4) restart mysqld with “innodb_force_recovery=4” in my.cnf : sudo service mysqld start
Now the “log in the future” problem should be gone with the ibdata1 file reconstructed. But all the data are gone, too.
5) restore the data: mysql -u root -p < all-databases.sql
6) you need to restart the mysqld again with “innodb_force_recovery=4”: sudo service mysqld restart
Otherwise you will get another error in your mysql.log file:

Post a Comment