faqts : Computers : Databases : MySQL : Common Problems : Killing MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

31 of 41 people (76%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How can I abort a slow query in MySQL?
Do all queries get killed if I kill the MySQL session?

May 11th, 2000 16:34
Nathan Wallace, Sasha Pachev


The query does always not die when the client dies - only if it tries to
write the data to the client. If it takes a while to produce the data,
it will be a while before it discovers that the client is dead. When you
issue the kill command, the thd->killed flag is set and the next time
the query processing code checks it (which happens on every iteration /
row read / quite frequently), it will no the query needs to be aborted.

You need to use the kill command in mysqladmin to properly abort a
query.