LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-14-2009, 03:13 PM   #1
SirTristan
Member
 
Registered: Feb 2006
Distribution: GNU/Linux
Posts: 54

Rep: Reputation: 15
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
 
Old 08-14-2009, 03:22 PM   #2
jrtayloriv
Member
 
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 365
Blog Entries: 1

Rep: Reputation: 44
You want killall mysqld instead of killall mysql

--jrtayloriv
 
Old 08-14-2009, 03:24 PM   #3
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,592

Rep: Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559Reputation: 2559
Quote:
Originally Posted by SirTristan View Post
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....
 
Old 08-14-2009, 03:25 PM   #4
SirTristan
Member
 
Registered: Feb 2006
Distribution: GNU/Linux
Posts: 54

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use only one "kill" to kill father and child processes Xosen Programming 7 08-28-2008 03:33 AM
when a process cann't be terminated through kill/skill/pkill/killall... Osirix Linux - Software 9 07-18-2006 11:16 PM
how to use kill to kill a batch of processes with same name? dr_zayus69 Linux - Software 2 09-03-2005 06:35 PM
kill/killall not working (?) didi156 Linux - Software 2 05-20-2004 11:47 PM
kill vs. killall, AIX vs. Linux thebeaglebeagle Linux - Newbie 1 09-24-2003 02:41 AM


All times are GMT -5. The time now is 09:54 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration