Kill multiple connections at once in AWS RDS

The quickest method for generating the kill statements that end the sleeping threads in RDS MySQL is as follows.

SELECT CONCAT(‘CALL mysql.rds_kill(‘,ID,’);’)
FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE command <> ‘Sleep’;

Hope this helps.

Leave a Reply