0% found this document useful (0 votes)
37 views1 page

(Connection - .

The KILL statement can terminate a connection or query associated with a thread running in MySQL. Each connection runs in a separate thread that can be identified by its processlist ID from various sources. KILL with no modifier terminates the connection and any statement it is running, while KILL QUERY only terminates the current statement. Users need the PROCESS or SUPER privilege to kill threads other than their own.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views1 page

(Connection - .

The KILL statement can terminate a connection or query associated with a thread running in MySQL. Each connection runs in a separate thread that can be identified by its processlist ID from various sources. KILL with no modifier terminates the connection and any statement it is running, while KILL QUERY only terminates the current statement. Users need the PROCESS or SUPER privilege to kill threads other than their own.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Syntax:

KILL [CONNECTION | QUERY] processlist_id

Each connection to mysqld runs in a separate thread. You can kill a


thread with the KILL processlist_id statement.

Thread processlist identifiers can be determined from the ID column of


the INFORMATION_SCHEMA.PROCESSLIST table, the Id column of SHOW
PROCESSLIST output, and the PROCESSLIST_ID column of the Performance
Schema threads table. The value for the current thread is returned by
the CONNECTION_ID() function.

KILL permits an optional CONNECTION or QUERY modifier:

o KILL CONNECTION is the same as KILL with no modifier: It terminates


the connection associated with the given processlist_id, after
terminating any statement the connection is executing.

o KILL QUERY terminates the statement the connection is currently


executing, but leaves the connection itself intact.

If you have the PROCESS privilege, you can see all threads. If you have
the SUPER privilege, you can kill all threads and statements.
Otherwise, you can see and kill only your own threads and statements.

You can also use the mysqladmin processlist and mysqladmin kill
commands to examine and kill threads.

*Note*:

You cannot use KILL with the Embedded MySQL Server library because the
embedded server merely runs inside the threads of the host application.
It does not create any connection threads of its own.

URL: http://dev.mysql.com/doc/refman/5.5/en/kill.html

You might also like