I'm following this guide to reset my mysql root password (I'm on ubuntu). When I kill the mysqld process, it immediately gets resurrected. The parent process ID is 1.

How can I find what keeps resurrecting mysqld?

$ ps -ef | grep mysql
mysql    30136     1  0 07:16 ?        00:00:00 /usr/sbin/mysqld
root     30295 30274  0 07:18 pts/0    00:00:00 grep --color=auto mysql
$ kill -9 30136
$ ps -ef | grep mysql
mysql    30302     1  2 07:18 ?        00:00:00 /usr/sbin/mysqld
root     30404 30274  0 07:18 pts/0    00:00:00 grep --color=auto mysql
$
link|improve this question

72% accept rate
I found that doing stop mysql or /etc/init.d/mysql stop will bring it down for good (use start to start it back up, of course). – ripper234 Jun 25 '11 at 7:27
feedback

2 Answers

up vote 2 down vote accepted

Ubuntu uses upstart:

http://upstart.ubuntu.com/

For future reference:

http://upstart.ubuntu.com/cookbook/#disabling-a-job-from-automatically-starting

link|improve this answer
feedback

You already found your answer - but for the sake of clarity.

You should try not to kill daemons or processes which are working okay - and you should certainly try and avoid kill -9. There is usually always a way to request daemons to stop gracefully which allow them to tidy up.

Kill on it's own (e.g. kill 30136 in your case) can sometimes correctly stop a process, but it depends on the process in question and what signals it is looking for.

link|improve this answer
The kill order was from mysql own website ... – ripper234 Jun 26 '11 at 6:09
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.