KILL 12345; Generate kill commands for all queries exceeding a threshold:
KILL [CONNECTION] <id>; Or if you only want to terminate the current query but keep the connection: mysql kill long running queries
-- Usage CALL kill_long_running_queries(120); -- kills queries running > 2 minutes Instead of just killing queries, prevent them from running too long: KILL 12345; Generate kill commands for all queries
How to Identify and Kill Long-Running Queries in MySQL -- kills queries running >