This article describes how to terminate Sessions in an apsaradb RDS for MySQL instance.
Alibaba Cloud reminds you that:
- Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
- You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.
- If you have authorized or submitted security information such as the logon account and password in the Alibaba Cloud Management console, we recommend that you modify such information in a timely manner.
Describes two methods to terminate Sessions in apsaradb RDS for MySQL.
Terminated by DMS
- Log on to the RDS Database. For more information about how to log on to the RDS Database, see log on to the RDS Database through DMS.
- Click performance at the top of the page. > Instance session.
- In the dialog box that appears, select a new version and authorize it. You must authorize the account only for your first logon.
- Shift and Ctrl to select sessions, and then kill selected sessions to terminate these sessions.
Run the kill command to terminate the
- Connect to an RDS for MySQL instance by using a MySQL CLI tool. For more information, see connect to instances.
Tips: The RDS instance is full, when the number of connections is full, you cannot connect to the instance through DMS or the MySQL command line tool. If you cannot connect to the RDS instance by using DMS or the MySQL CLI, we recommend that you set the wait_timeout parameter in the parameter settings section to a small value, for example, 60, so that the RDS instance closes connections that are idle for more than 60 seconds. Then, you can use DMS or MySQL CLI to connect to the instance.
- Run the following command to view the current session and record the Id of the session to be terminated.
show processlist;The following command output is returned.
- Run the following command to terminate a session:
Note:[$ID] indicates the Id recorded in the previous step.The following command output is returned.
- ApsaraDB RDS for MySQL