Wednesday 19 June 2013

Cannot start mysql

Problem:
[~]# /etc/init.d/mysql status
ERROR! MySQL is not running, but lock exists

 [~]# /etc/init.d/mysql start
 Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/*)

Solution:

 [~]# ps aufx | grep mysql
 If it shows the mysql process, Kill that mysql process using
[~]#killall mysql

  [~]# rm -f /var/lock/subsys/mysql

 [~]# /etc/init.d/mysql start

 If still it doesnt  solve the issue,
 it may be that MySQL is not starting because it is unable to load a variable set in /etc/my.cnf.
If there are a lot of entries in your my.conf, it may be easier to mv /etc/my.cnf to something like /etc/my.cnf.old and then see if MySQL starts.

Also, check the mysql log file and see what it says. A few examples:

1.Error:

MySQL installation Error - InnoDB: Error: pthread_create returned 11 

Apply this fix :
  [~]#ulimit -s unlimited
Then start mysql again.
2.Error:





Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 

 

Apply this fix :


Go to the data directory and remove log files look like ib_logfile0, ib_logfile1 and ib_logfile2.  Then start mysql.

3.Error:
 ERROR! MySQL manager or server PID file could not be found!

Apply this fix :

Go to  /etc/my.cnf file
 Put the below in your my.cnf then try again.

skip-innodb

  This will skip the InnoDB engine on startup. If the problem is related to InnoDB, MySQL will start without InnoDB support.

No comments:

Post a Comment