Ending a session or query - Amazon Aurora
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Ending a session or query

The following stored procedures end a session or query.

mysql.rds_kill

Ends a connection to the MySQL server.

Syntax

CALL mysql.rds_kill(processID);

Parameters

processID

The identity of the connection thread to be ended.

Usage notes

Each connection to the MySQL server runs in a separate thread. To end a connection, use the mysql.rds_kill procedure and pass in the thread ID of that connection. To obtain the thread ID, use the MySQL SHOW PROCESSLIST command.

Examples

The following example ends a connection with a thread ID of 4243:

call mysql.rds_kill(4243);

mysql.rds_kill_query

Ends a query running against the MySQL server.

Syntax

CALL mysql.rds_kill_query(queryID);

Parameters

queryID

The identity of the query to be ended.

Usage notes

To stop a query running against the MySQL server, use the mysql_rds_kill_query procedure and pass in the ID of that query. To obtain the query ID, query the MySQL INFORMATION_SCHEMA PROCESSLIST table. The connection to the MySQL server is retained.

Examples

The following example stops a query with a thread ID of 230040:

call mysql.rds_kill_query(230040);