LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using killall to kill mysql processes? (https://www.linuxquestions.org/questions/linux-newbie-8/using-killall-to-kill-mysql-processes-747607/)

SirTristan 08-14-2009 03:13 PM

Using killall to kill mysql processes?
 
I'm attempting to use 'killall' to kill all mysql processes, however after using the command mysql processes are still alive. 'killall mysql' says no processes were killed, and while 'killall mysql_safe' gives no message there are still mysql processes alive afterwards.

Below are the commands I was using and their output. What is my mistake?
Code:

# killall mysql
mysql: no process killed
# killall mysqld_safe
# ps -aux|grep mysql
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.3/FAQ
root      1962  0.0  0.0  2972  444 pts/0    S+  16:10  0:00 grep -i mysql
root    25094  0.0  0.0  6116 1236 pts/0    S    15:57  0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/alaska.rackco.com.pid
mysql    25115 43.4  1.1 180852 92532 pts/0  Sl  15:57  5:38 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/alaska.rackco.com.pid --skip-external-locking


jrtayloriv 08-14-2009 03:22 PM

You want killall mysqld instead of killall mysql

--jrtayloriv

TB0ne 08-14-2009 03:24 PM

Quote:

Originally Posted by SirTristan (Post 3643601)
I'm attempting to use 'killall' to kill all mysql processes, however after using the command mysql processes are still alive. 'killall mysql' says no processes were killed, and while 'killall mysql_safe' gives no message there are still mysql processes alive afterwards.

Below are the commands I was using and their output. What is my mistake?
Code:

# killall mysql
mysql: no process killed
# killall mysqld_safe
# ps -aux|grep mysql
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.3/FAQ
root      1962  0.0  0.0  2972  444 pts/0    S+  16:10  0:00 grep -i mysql
root    25094  0.0  0.0  6116 1236 pts/0    S    15:57  0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/alaska.rackco.com.pid
mysql    25115 43.4  1.1 180852 92532 pts/0  Sl  15:57  5:38 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/alaska.rackco.com.pid --skip-external-locking


Your mistake was using killall to try to stop mysql. Use "/etc/init.d/mysql stop" instead. A "kill -9" or a killall, should only be used when nothing else works, or if there aren't any graceful shutdown options left....

SirTristan 08-14-2009 03:25 PM

Thank you, I believe that worked :)
Code:

# killall mysqld
# ps aux|grep mysql
root    12288  0.0  0.0  3508  448 pts/0    S+  16:23  0:00 grep -i mysql



All times are GMT -5. The time now is 08:22 AM.