Live Help

Email

Skype Chat
Yahoo Chat

Client portal

VPS Service

mysql failed to start due to corrupted innoDB

December 28, 2015     0 comments

If you ever have the fail to start and getting this error while starting the mysql service:

ERROR! MySQL server PID file could not be found!
Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/mydomain.com.pid).

if you have tried many different ways like recreating the pid, kill pid, etc and still does not, try with this steps:

(the error may be: 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:http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: for more information. )

1) backup all the data : mysqldump -u root -p --all-databases > all-databases.sql

2) stop mysqld: service mysqld stop

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 : 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:

InnoDB: Error: table `xxx`.`xx` does not exist in the InnoDB internal
InnoDB: data dictionary though MySQL is trying to drop it.
InnoDB: Have you copied the .frm file of the table to the
InnoDB: MySQL database directory from another database?
InnoDB: You can look for further help from
InnoDB:http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html


For the step #5, what you can do, is to restore the original my.cnf, restart the mysql service, and then restore the database. Once done, dont forget to rebuild your tables again to ensure consistency. restart the mysql again to ensure it's running UP succesfully.


In some events, you may need to "clean start" your server, meaning, reboot your server, ensure that mysql is not able to boot up, then follow step #1 and so on.


For some alternative, do not put anything to /etc/my.cnf and try to start the mysql. if it works, dump all the databases like shown in the step #1


If you are running on myisam, you can try this:

service mysql stop 
mkdir /home/tmp
cd /var/lib/mysql
myisamchk --tmpdir=/home/tmp -r */*.MYI
service mysql start

How helpful was this article to you?

cPanel Partner NOC