Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to kill all my mysqld process. But remains one, why?

javier@javier-mbp:~$ ps aux | grep mysqld
root       913  0.0  0.0   4220   704 ?        S    16:11   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/javier-mbp.pid
mysql     1408  0.1  2.0 609900 84480 ?        Sl   16:11   0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/var/log/mysql/error.log --pid-file=/usr/local/mysql/data/javier-mbp.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
javier    1995  0.0  0.0  13128  1056 pts/0    S+   16:12   0:00 grep --color=auto mysqld
javier@javier-mbp:~$ pkill mysqld
pkill: 913 - Operation not permitted
pkill: 1408 - Operation not permitted
javier@javier-mbp:~$ sudo pkill mysqld
[sudo] password for javier: 
javier@javier-mbp:~$ ps aux | grep mysqld
javier    2020  0.0  0.0  13124  1060 pts/0    S+   16:13   0:00 grep --color=auto mysqld
javier@javier-mbp:~$ 
share|improve this question
add comment

2 Answers

up vote 10 down vote accepted

The ps command is showing the grep mysqld command to which you piped the ps. No instance of mysqld is running.

share|improve this answer
    
Yes, and use killall instead of kill –  Barafu Albino Apr 8 '13 at 5:58
add comment

Try the following command to kill mysqld:

kill -9 `pgrep mysqld`

man kill tells us that KILL (9) is used to force the signal to kill the application.

share|improve this answer
    
This does not answer the question. The process that the OP believes it's remaining is not mysql but the grep mysql. –  Matteo Apr 8 '13 at 5:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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