Kill session or query in AWS RDS for MYSQL or MariaDB

Kill process or query in AWS RDS for MySQL or MariaDB

Kill Session in AWS RDS for MySQL or MariaDB:

--Check the process list by query:

Id|User|Host           |db|Command|Time |State   |Info                 |Progress|
 7|root|localhost:51694|  |Sleep  |28652|        |                     |     0.0|
 8|root|localhost:51695|  |Sleep  |  327|        |                     |     0.0|
 9|root|localhost:51696|  |Query  |    0|starting|SHOW FULL PROCESSLIST|     0.0|

--Kill the session 8
CALL mysql.rds_kill(processID);

CALL mysql.rds_kill(8);

Kill the running query in Amazon RDS Service: MySQL or MariaDB.

--Check the Queryid:
select query_id, info from information_schema.PROCESSLIST p 
query_id|info                                                                   |
     163|select query_id,info from information_schema.PROCESSLIST p¶LIMIT 0, 200|
     149|Select * from employees                                                |

--Kill the running query:
CALL mysql.rds_kill_query(queryID);

CALL mysql.rds_kill_query(149);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.