Bug #20781 KILLALL [WHERE condition, ...]
Submitted: 29 Jun 2006 16:38 Modified: 30 Jun 2006 13:43
Reporter: Dean Swift Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S4 (Feature request)
Version:5.0.22 OS:Microsoft Windows (Windows)
Assigned to: CPU Architecture:Any
Triage: Triaged: D5 (Feature request)

[29 Jun 2006 16:38] Dean Swift
Description:
It would be useful to drop multiple connections with a single command. This could be performed with a KILLALL command, which is consistent with Unix. Furthermore, the conditions could be SQL conditions, for example KILLALL WHERE user='bob', KILLALL WHERE user<>'root', KILLALL WHERE host LIKE 'backup.%' or KILLALL WHERE db='world'.

How to repeat:
mysql> SHOW PROCESSLIST;
+----+------+----------------+-------+---------+------+-------+-----------------
-+
| Id | User | Host           | db    | Command | Time | State | Info
 |
+----+------+----------------+-------+---------+------+-------+-----------------
-+
|  1 | root | localhost:1092 | world | Query   |    0 | NULL  | SHOW PROCESSLIST
 |
+----+------+----------------+-------+---------+------+-------+-----------------
-+
1 row in set (0.00 sec)

mysql> KILLALL WHERE user=root;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'KILLA
LL WHERE user=root' at line 1

Suggested fix:
Currently requires a script but this increases scope for error.
[30 Jun 2006 13:43] Valeriy Kravchuk
Thank you for a reasonable feature request.
[14 Aug 2009 20:05] Mo Sayed
It's been a few years since this feature was requested. I'd like to second this feature request, it would be tremendously useful.