Skip to main content

KILL QUERY

Attempts to forcibly terminate the currently running queries.

Syntax

KILL QUERY|CONNECTION <query_id>

Examples

mysql> show processlist;
+--------------------------------------+-------+-----------------+------+-------+----------+--------------------------------------------------------------------------------------+--------------+------------------------+-------------------------+-------------------------+--------------------------+
| id | type | host | user | state | database | extra_info | memory_usage | dal_metrics_read_bytes | dal_metrics_write_bytes | scan_progress_read_rows | scan_progress_read_bytes |
+--------------------------------------+-------+-----------------+------+-------+----------+--------------------------------------------------------------------------------------+--------------+------------------------+-------------------------+-------------------------+--------------------------+
| e04dd121-88f4-4290-85be-2b45c6e3b011 | MySQL | 127.0.0.1:65291 | root | Query | default | select sum(number) from numbers_mt(10000000000) group by number%3, number%4,number%5 | 0 | 0 | 0 | 2391200000 | 19129600000 |
| 179c99d5-1894-4d4c-a89e-4b293d404c88 | MySQL | 127.0.0.1:64597 | root | Query | default | show processlist | 0 | 0 | 0 | 0 | 0 |
+--------------------------------------+-------+-----------------+------+-------+----------+--------------------------------------------------------------------------------------+--------------+------------------------+-------------------------+-------------------------+--------------------------+
2 rows in set (0.01 sec)
Read 2 rows, 492 B in 0.002 sec., 860.73 rows/sec., 211.74 KB/sec.

mysql> kill query 'e04dd121-88f4-4290-85be-2b45c6e3b011';
Query OK, 0 rows affected (0.00 sec)
Read 0 rows, 0 B in 0.000 sec., 0 rows/sec., 0 B/sec.