Skip to content

Instantly share code, notes, and snippets.

@johndpope
Forked from ffeast/mysql_kill_queries.sql
Created October 11, 2016 17:55
Show Gist options
  • Save johndpope/1a468b151b8db4b0897e543de94bc717 to your computer and use it in GitHub Desktop.
Save johndpope/1a468b151b8db4b0897e543de94bc717 to your computer and use it in GitHub Desktop.
Mysql kill queries
/* run \. /tmp/mysql_victims.txt after executing this query */
SELECT
concat('KILL ', id, ';')
FROM
information_schema.processlist
WHERE
user='victim' AND time > 60
INTO OUTFILE '/tmp/mysql_victims.txt';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment