GNU Info

Info Node: (mysql.info)KILL

(mysql.info)KILL


Next: SHOW Prev: FLUSH Up: Database Administration
Enter node , (file) or (file)node

`KILL' Syntax
-------------

     KILL thread_id

Each connection to `mysqld' runs in a separate thread.  You can see
which threads are running with the `SHOW PROCESSLIST' command and kill
a thread with the `KILL thread_id' command.

If you have the *process* privilege, you can see and kill all threads.
Otherwise, you can see and kill only your own threads.

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

When you do a `KILL', a thread specific `kill flag' is set for the
thread.

In most cases it may take some time for the thread to die as the kill
flag is only checked at specific intervals.

   * In `SELECT', `ORDER BY' and `GROUP BY' loops, the flag is checked
     after reading a block of rows. If the kill flag is set the
     statement is aborted

   * When doing an `ALTER TABLE' the kill flag is checked before each
     block of rows are read from the original table. If the kill flag
     was set the command is aborted and the temporary table is deleted.

   * When doing an `UPDATE TABLE' and `DELETE TABLE', the kill flag is
     checked after each block read and after each updated or delete
     row. If the kill flag is set the statement is aborted.  Note that
     if you are not using transactions, the changes will not be rolled
     back!

   * `GET_LOCK()' will abort with `NULL'.

   * An `INSERT DELAYED' thread will quickly flush all rows it has in
     memory and die.

   * If the thread is in the table lock handler (state: `Locked'), the
     table lock will be quickly aborted.

   * If the thread is waiting for free disk space in a `write' call, the
     write is aborted with an disk full error message.

SHOW
`SHOW' Syntax

automatically generated by info2www version 1.2.2.9