fixing a corrupted mysql database that does not want to start up

Just this week I was trying to load an old WordPress website I had lurking locally on my PC. I hadn’t touched it in months to the point where I forgot what stage of development I was on. My setup in this case was a Xampp server and through it I would load both Apache and MySql, then open up PhpMyAdmin and just fiddle in there. Straight away I was facing an issue when clicking on the Start button in Xampp to fire up MySql. Don’t know what was up with it so naturally I opened up the mysql_error.log file. There were a bunch of different ones but the predominant one was this one.

[ERROR] InnoDB: Page [page id: space=0, page number=307] log sequence number 45608603 is in the future! Current system log sequence number 45109372.
[ERROR] InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.

Without sounding like a MySql expert (because really and truly I’m not and the only times I ever used was for little WordPress projects) the solution that worked for me was stopping anything that was running on Xampp and open command prompt in admin mode. I would then simply execute the following command.

mysqld --skip-grant-tables

MySql would then show as running on Xampp, if Apache was not running then turn it back on, and hopefully you should be able to navigate to http://localhost/phpmyadmin/. Hope this was useful as it was to me, thanks for reading!

Leave a comment