Menu

MySQL Error 1203: Too Many User Connections

Fix MySQL Error 1203 by checking the affected user@host connection cap, shared application pools, and max_user_connections settings.

Posted on By Updated on
On this page

MySQL Error 1203 (42000, ER_TOO_MANY_USER_CONNECTIONS) means one account has reached its simultaneous-connection limit. This differs from Error 1040, which means the server has reached its global max_connections limit. See the MySQL 8.4 error reference.

Check how many connections the affected account is using

If Performance Schema account statistics are enabled, an administrator can inspect the current connections grouped by the actual MySQL account:

SELECT
  USER,
  HOST,
  CURRENT_CONNECTIONS,
  TOTAL_CONNECTIONS
FROM performance_schema.accounts
WHERE USER = 'app_user'
ORDER BY CURRENT_CONNECTIONS DESC;

Replace app_user with the user named in the error. performance_schema.accounts groups current sessions by user and client host; the resource limit is stored on the matching MySQL user@host grant row. If that grant row uses a host pattern that matches multiple client hosts, add the counts for all those client-host rows when estimating its usage. MySQL documents both the performance_schema.accounts table and account host matching rules. If account statistics are disabled or the row is absent, ask an administrator to inspect the server’s account and process information.

Check the global default limit as well:

SHOW GLOBAL VARIABLES LIKE 'max_user_connections';

An account can have its own MAX_USER_CONNECTIONS value. A nonzero per-account value sets that account’s limit; a value of zero uses the global max_user_connections value. If the global value is also zero, there is no per-account simultaneous-connection limit. See MySQL account resource limits.

If a connection for the affected account is still open, SHOW SESSION can show the limit initialized for that session:

SHOW SESSION VARIABLES LIKE 'max_user_connections';

For the limit that applies to new connections, use the current matching mysql.user account row and the global default. The session value is initialized when the connection is created, so it may not reflect a limit changed after that session began.

If every connection for the account is rejected, an administrator can inspect the relevant account rows and compare their max_user_connections values with the global default:

SELECT User, Host, max_user_connections
FROM mysql.user
WHERE User = 'app_user';

This system-table query requires suitable administrative access. It can return multiple host patterns for the same user; confirm which user@host account matches the application connection before changing a limit.

Estimate pool capacity for the account

For the load-testing workflow to choose per-instance pool limits across replicas and deployments, see How to Size a MySQL Connection Pool.

Use the effective max_user_connections value for the affected account, the current number of other sessions across all client hosts matching that same account, and the maximum capacity of the pool or pools being planned. From a still-open session using the account, SHOW SESSION VARIABLES LIKE 'max_user_connections' reports the limit initialized for that session; enter 0 if it means no per-account simultaneous-connection cap. An account without its own cap is still subject to the global server limit; use the MySQL connection pool budget estimator to compare ordinary workloads with max_connections.

Reduce pool demand or adjust the correct account limit

Count every app replica, worker, scheduled task, and service that connects as the affected account. A pool’s maximum applies per process or instance, so multiply the pool size by the number of independent pools. Also check whether unrelated jobs share the same user@host account.

If the account limit is intentional, cap each pool so their combined peak fits within it. If the workload legitimately needs more simultaneous connections, ask a database administrator to review the account’s MAX_USER_CONNECTIONS setting and the server’s global capacity before changing the limit. Do not give application accounts the CONNECTION_ADMIN privilege to bypass connection limits.

If a connection was just closed, a rapid reconnect can briefly fail while MySQL finishes processing the disconnect. Avoid tight retry loops; let the server complete cleanup and confirm that the application returns connections to the pool correctly. MySQL documents this disconnect/reconnect edge case in its account resource limit guidance.

Distinguish the account limit from other connection failures

  • Error 1203: the matching account reached its simultaneous-connection limit; check MAX_USER_CONNECTIONS and all pools sharing user@host.
  • Error 1040: the global max_connections limit is full; see MySQL Error 1040.
  • Error 1045: authentication was rejected; see MySQL Error 1045.

For other connection and SQL failures, browse MySQL Error Troubleshooting.