Not the answer you need?
Register and ask your own question!

auto restart on kill

peter9370peter9370 EntrantCurrent User Role Contributor
Sorry if this is a FAQ - I've googled high and low for an answer and not found anything specific.

I'm running Percona 5.6.29 under ubuntu 14.04. Recently, I had to issue "kill -9" to shut down a mysqld process (I really had no option - I'd issued a normal service shutdown command which had triggered mysqladmin shutdown; the error log showed clearly that the shutdown process had started; after 20 minutes, it had still not shut down fully; I verified that no data was being written to either the error log or to any files in the database directory.)

After the "kill -9", mysqld restarted automatically (and - fortunately - successfully.)

My question is - how can mysqld be prevented from restarting automatically after a "kill -9"? I appreciate that under normal conditions, if mysql crashes for some reason, it should try to restart (I think.) However, in this particular case, I really didn't want it to restart before I had had a chance to look through the logs and do other forensic checks and cleanups. If there had been a serious error condition, an automatic restart could have resulted in even more damage.


  • jriverajrivera Percona Support Engineer Percona Staff Role
    MySQL uses two processes, mysqld and mysqld_safe, if you kill mysqld process only and leave mysqld_safe running it will spawn another mysqld process. If you need to kill mysql kill both mysqld and mysqld_safe processes (kill -9 pidof_mysqld pidof_mysqld_safe)
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.