スレッドの情報表示と KILL

実行中のSQLを全て表示(最初の100文字のみ)

show processlist;

スレッドの情報表示

show full processlist;

スレッドを切断

kill スレッド番号;

スレッド一覧を表示して、指定されたスレッドを切断例

mysql> show full processlist;
+----+------+----------------+------+---------+------+--------------+------------------------+
| Id | User | Host           | db   | Command | Time | State        | Info                   |
+----+------+----------------+------+---------+------+--------------+------------------------+
|  1 | ODBC | localhost:1544 | test | Query   | 0    | NULL         | show full processlist  |
|  5 | ODBC | localhost:1557 | test | Query   | 4    | Sending data | select * from test     |
+----+------+----------------+------+---------+------+--------------+------------------------+
2 rows in set (0.00 sec)

mysql> kill 5;
Query OK, 0 rows affected (0.00 sec)

mysql> show full processlist;
+----+------+----------------+------+---------+------+-------+-----------------------+
| Id | User | Host           | db   | Command | Time | State | Info                  |
+----+------+----------------+------+---------+------+-------+-----------------------+
|  1 | ODBC | localhost:1544 | test | Query   | 0    | NULL  | show full processlist |
+----+------+----------------+------+---------+------+-------+-----------------------+
1 row in set (0.00 sec)

mysql>