LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-29-2009, 08:58 AM   #1
jindalarpan
Member
 
Registered: Mar 2006
Posts: 94

Rep: Reputation: 15
mysql thread kill


Hi All
what is the way to kill the thread in mysql.
when ever i try to kill the running thread in mysql most of the time is is not killing it, it just changes the state to killed. And that thread keeps on running.

kindly let me know how i can forceful kill it at that very moment only.

Thanks
 
Old 07-30-2009, 07:43 PM   #2
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
If you really want to kill it, then

# kill -9 pid

where pid is the process id. You can get more detail from `man kill`.
 
Old 07-31-2009, 03:47 AM   #3
jindalarpan
Member
 
Registered: Mar 2006
Posts: 94

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by choogendyk View Post
If you really want to kill it, then

# kill -9 pid

where pid is the process id. You can get more detail from `man kill`.
this will kill the mysql but i want to kill the one of the thread inside mysql
 
Old 08-01-2009, 08:12 AM   #4
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
oops. Sorry for the misunderstanding. Also for so blithely suggesting kill -9 on a database. I was just assuming that if you really wanted to kill it, then you must know what you were doing. (In my defense, it was my 666th post and was probably doomed from the start ).

In general, killing things is a last resort. With a database, there can potentially be serious issues with consistency if processes are not allowed to finish up properly.

If you check out http://dev.mysql.com/doc/refman/4.1/en/kill.html, you'll see a fairly complete explanation. Within MySQL, kill simply sets a kill flag. It may take a while for that to take effect. To maintain consistency within the database, it has to be done carefully, and can only be done at certain checkpoints. If you are using transactions, the changes for that process get rolled back. So the act of killing a process within MySQL is not as simple as the act of killing a process in UNIX/Linux.
 
Old 09-19-2009, 02:16 PM   #5
jindalarpan
Member
 
Registered: Mar 2006
Posts: 94

Original Poster
Rep: Reputation: 15
tried multiples ways but not able to kill running thread .
Any ont can help ?
 
Old 09-20-2009, 03:26 PM   #6
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Did you read through the link at dev.mysql.com explaining the constraints on killing a process within MySQL?

I think you will have to post a substantial bit more detail to get any help. It is impossible to tell what you are encountering or what you are trying to do or expecting as a result. Clearly, you can't do a kill and expect it to just die on the spot. Can you tell us what the process is, what it's relationship to other processes is, what the MySQL thing is that you are running, what commands you are issuing to attempt the kill, and what you see in terms of response over time? That it doesn't kill right away is expected. How long have you watched and seen it still running? And what other things are going on that might constrain the killing of that process?
 
  


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
[C/C++] How to kill a thread in fgets hwoarang Programming 3 09-09-2008 02:59 PM
Does killing the thread kill its parent process? piyush.kansal Programming 7 07-09-2007 08:11 PM
how to kill a thread in python shanenin Programming 2 12-13-2005 11:13 PM
How to kill a user thread in Linux.... Help me rajsun Programming 4 04-20-2005 04:13 AM
Please move my thread or kill it or something. :-( gplacek Slackware 1 08-27-2004 01:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:34 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration