Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/
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/ --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
share|improve this question
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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .