Kill Processes MySQL

First, execute below command to see all active processes.

SHOW PROCESSLIST;

Use below command to kill a specific process.

Syntax:

KILL id;

Example

KILL 5;

Use below command to kill all processes.

SELECT CONCAT('KILL ',id,';') 
FROM information_schema.processlist 
WHERE user='root' INTO OUTFILE '/tmp/processlist.txt';

Use below command to kill all processes of a user.

kill USER username;