• Context: Ran a backup thinking it'd take no more than 1-hour... and it's still going. The process is a MySQL DB backup that has the DB tables locked.
  • OS: CentOS-5.x
  • Goal: Find and kill remotely a process running on CentOS-5.x

Possible Requested Help:

(1) How do I find it, meaning how do I view all process and sort by CPU use; since I have no idea what the process is, but I'm guessing it's taking up most the CPU cycles now and has a name I'll figure out.

(2) How do I kill it. Please use the following notation, where # is the CMD-line itself: # cd / -- meaning change directory to root. If the command allows sudo to be used, include it if if it's unlikely to be needed, example: # sudo cd /secure -- meaning change directory to /secure based on sudo rights.

NOTE: Really not sure if the above is clear, so if you have any questions, please comment and I'll reply. Thanks!

3 Answers 3


top will show you the processes on the system, sorted in default by CPU usage. Press k to select a process to kill. Press q when you want to exit top.

  • @Ignacio Vazquez-Abrams: +1 Thanks, I'll try it right now.
    – blunders
    Nov 5, 2010 at 11:08
  • @Ignacio Vazquez-Abrams: Entered the PID, hit ENTER, and got this: "Kill PID 2 with signal [15]:" -- did a quick google search and it appears I enter the number "9" -- is that correct, and if so, what does that mean? For now, I exited top, and then ran it again to confirm the PID is still running; which it is.
    – blunders
    Nov 5, 2010 at 11:15
  • 1
    9 is SIGKILL, which is a bit harsh since it doesn't let the program do any cleanup. Give it 15 (SIGTERM) then wait a bit. If it still refuses to die, then you can try SIGKILL. Nov 5, 2010 at 11:25
  • 1
    If you want to kill arbitrary processes then you will need to run top as root, whether you use sudo or log in as root directly. Nov 5, 2010 at 11:26
  • 1
    Having locked the tables is bad; you'll probably have to restart MySQL after killing it. Also, top itself doesn't require root permissions, only killing the process may (but since there's no way to separate that from top...). Nov 5, 2010 at 11:44

Or You may try htop :)

yum install htop
  • how would I use htop to solve this problem?
    – blunders
    Nov 5, 2010 at 11:38
  • You can run htop command, then press F6 to sort by CPU, memory, etc usage, then select proccess from the list, then press F9 and select signal which will be send to the process, for example to send sigkill (9) press 9 and then hit enter :) Nov 5, 2010 at 12:05

Its unlikely to be delayed due to CPU usage - it should be spending most of its time sleeping while I/Os going on. And you should not kill the client process - kill the client connection on the DBMS - see

mysqladmin processlist


mysqladmin kill

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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