MySQL fails on restart / reboot

kmarshall

New member
Joined
Jun 20, 2010
Messages
1
I am running directadmin on ubuntu with da_updates on.

When the auto updates are performed, the server reboots and mysql has an error.

I can see that the "mysql pid" process is running in directadmin cp, but website services cannot connect to database after a restart.

I can solve this each time only by killing the PID of the process, then running:

/usr/local/directadmin/scripts/mysqld start

I believe that when the server is restarted/rebooted the wrong MySQL is started (directadmin was installed not on totally blank server as mysql existed before install).

How do I check and change so that on server reboot, the correct MySQL is being started ? where do I look and how do I check the services being started ?

I have tried adding the following to /etc/rc.local on my ubuntu server, however this does not work..

/etc/init.d/mysql stop
/etc/init.d/mysqld stop
/usr/local/directadmin/scripts/mysqld start


Thanks for your help!
 
Last edited:
I had this issue before in Centos 5 box.
I solve it by installing Webmin and stop the unnecessary services from running on boot.

Or you can type "setup" in your shell and chose "system services" then uncheck the unnecessary services so it doesn't start with booting (like remove Mysql and leave Mysqld checked)

I don't know if the command "setup" works in Debian or not, I did it on Redhat platform.
 
Code:
killall -9 mysqld
is dangerous and could cause data loss. Better to first exhaustively try:
Code:
killall mysqld
until all processes are gone.

However, better still is to use DirectAdmin to stop MySQL even if you have to try multiple times, to make sure that DirectAdmin won't attempt to start it again every minute.

If you do use DirectAdmin to stop it, and then restart it from the shell, remember that DirectAdmin won't be monitoring it. If you stop it from the control panel to stop the monitor from attempting to restart it, then you should start it from the control panel, so the monitoring will start again.

Jeff
 
Back
Top