All Products
Search
Document Center

ApsaraDB RDS:What do I do if the "has more than 'max_user_connections'" or "has exceeded the 'max_user_connections'" error message is displayed when I connect to an ApsaraDB RDS for MySQL instance?

Last Updated:Jul 25, 2024

The max_user_connections parameter specifies the maximum number of connections that are allowed for a database on an AparaDB RDS for MySQL instance. If the "has more than 'max_user_connections' active connections" error message, the "User 'xxx' has exceeded the 'max_user_connections' resource" error message, or an error message related to the max_user_connections parameter is displayed when you connect to a database on an RDS instance, you can use the solutions that are described in this topic to fix this issue.

Problem description

You cannot connect to a database on an RDS instance by using Data Management Service (DMS) or a database client, and an error message related to the max_user_connections parameter is displayed.

Cause

The number of connections to the database on the RDS instance reaches the upper limit.

Problem identification

Log on to the ApsaraDB RDS console

Use the SQL Explorer and Audit feature

After you enable the SQL Explorer and Audit feature for an RDS instance, SQL statements from database kernels, the accounts and IP addresses that are used to execute the SQL statements, and execution details are automatically recorded without affecting the performance of the RDS instance. For more information, see Use the SQL Explorer and Audit feature.

Note

You are charged for the use of the SQL Explorer and Audit feature. For more information, see Feature description and billing rules.

Procedure
  1. Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.

  2. In the left-side navigation pane, choose Autonomy Services > SQL Explorer and Audit.

  3. Enable the SQL Explorer and Audit feature.

Use the session management feature

You can use the session management feature to view all sessions, active sessions, and abnormal sessions of the RDS instance. You can also view the parameters related to sessions, such as User, Hostname, Execution Duration (s), and Status. For more information, see Use the session management feature.

Procedure
  1. Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.

  2. In the left-side navigation pane, choose Autonomy Services > Diagnostics.

  3. On the Diagnostics page, click the Session Management tab to view the parameters related to the current session, such as User, Hostname, Execution Duration (s), and Status.

Use SQL statements

Note

The number of connections to an RDS instance reaches the upper limit. As a result, new sessions cannot be established to the RDS instance and SQL statements cannot be executed. If historical sessions are retained in Data Management (DMS), you can execute SQL statements to view the sessions.

You can connect to an RDS instance from an Elastic Compute Service (ECS) instance or log on to the DMS console to connect to the RDS instance. You can execute the following SQL statement to view the slow threads and handle them. For more information, see the following topics:

SHOW PROCESSLIST;

The following table describes the returned result. The source IP address is displayed in the Host column.

Solution

  1. View the details of the established sessions of the RDS instance

    1. Log on the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the instance ID.

    2. In the left-side navigation pane of the page that appears, choose Autonomy Services > Diagnostics.

    3. On the page that appears, click the Session Management tab. On the Session Management tab, view the details of the sessions established to the RDS instance. For more information, see Session management.

  2. View the configuration of the max_user_connections parameter of the database on the RDS instance.

    You can use one of the following methods to view the value of the max_user_connections parameter:

    • Log on to the ApsaraDB RDS console.

      1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the instance ID.

      2. In the left-side navigation pane of the page that appears, click Parameters.

      3. On the Modifiable Parameters tab, view the value of the max_user_connections parameter.

    • Log on to the database and execute the following statement to view the value of the max_user_connections parameter:

      show variables like 'max_user_connections';

  3. After you confirm that the memory resources are sufficient, change the value of the max_user_connections parameter to a larger value. For more information, see Modify the parameters that specify the maximum number of connections.

  4. If the issue persists, use the following methods: