SELECT* FROM information_schema.processlist WHEREuser<>'system user'and COMMAND !='Sleep'and info like'%SELECT%' orderby `time` desc;
Id `User` Host db Command `Time` State Info
Id: thread ID.
db: database name.
Command: Query, Sleep(the session is idle).
Time: the time in seconds that the thread has been in its current state. For a replica SQL thread, the value is the number of seconds between the timestamp of the last replicated event and the real time of the replica host.
Info: the statement the thread is executing, or NULL if it is executing no statement.
Kill Threads By Thread ID
Kill a Particular Thread
KILL {processlist_id};
get kill all your MySQL queries
SELECT GROUP_CONCAT(CONCAT('KILL ',id,';') SEPARATOR ' ') FROM information_schema.processlist WHEREuser<>'system user'and COMMAND !='Sleep'and info like'%SELECT%';
KILL 1; KILL 2;
SELECT CONCAT('KILL ',id,';') AS kill_list FROM information_schema.processlist WHEREuser<>'system user'and COMMAND !='Sleep'and info like'%SELECT%';