Skip to content

Instantly share code, notes, and snippets.

@caseyw
Created March 6, 2014 15:27
Show Gist options
  • Save caseyw/9392128 to your computer and use it in GitHub Desktop.
Save caseyw/9392128 to your computer and use it in GitHub Desktop.
To terminate user sessions or queries on DB instances, Amazon RDS provides the following commands:
PROMPT> CALL mysql.rds_kill(thread-ID)
PROMPT> CALL mysql.rds_kill_query(thread-ID)
For example, to kill the session that is running on thread 99, you would type the following:
PROMPT> CALL mysql.rds_kill(99);
To kill the query that is running on thread 99, you would type the following:
PROMPT> CALL mysql.rds_kill_query(99);
@jonathanhle
Copy link

THANK YOU!

Copy link

ghost commented Mar 2, 2017

Very useful, Thank you!

@thiagomgo
Copy link

thiagomgo commented Apr 26, 2017

Also, we may get output of commands running it:
select concat('CALL mysql.rds_kill( ',id,');') from information_schema.processlist where user='USER_NAME' and DB='DB_NAME';

@ChrisEuphoria
Copy link

image
How would one go about getting rid of these?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment