1203ERRORTier 1 — Safe✅ HIGH confidence

User has exceeded the max_user_connections resource

Category: ConnectionVersions: All MariaDB / MySQL versions

🔴 Production Risk Error

HIGH — users are locked out while the limit is exceeded.

What this means

Error 1203 (SQLSTATE 42000) is returned when a specific user account has reached the max_user_connections limit — either the global setting or a per-user resource limit set via GRANT. Unlike error 1040 which limits total server connections, 1203 is per-user.

Why it happens

  1. 1The user account has a MAX_USER_CONNECTIONS resource limit set via ALTER USER or GRANT
  2. 2The global max_user_connections variable is non-zero and the user has reached it
  3. 3Connection leaks in the application are exhausting the per-user slot

How to reproduce

A user exceeds their per-user connection limit.

trigger — this will ERROR
-- Check per-user limit:
SELECT user, max_user_connections FROM mysql.user WHERE user = 'appuser';
ERROR 1203 (42000): User appuser already has more than 'max_user_connections' active connections

Fix 1: Increase or remove the per-user connection limit

When the limit is artificially low for the workload.

fix
-- Remove per-user limit:
ALTER USER 'appuser'@'localhost' WITH MAX_USER_CONNECTIONS 0;
FLUSH PRIVILEGES;

-- Or raise it:
ALTER USER 'appuser'@'localhost' WITH MAX_USER_CONNECTIONS 50;

Why this works

Setting MAX_USER_CONNECTIONS to 0 means no per-user limit; the global max_connections limit still applies.

Fix 2: Fix connection leaks in the application

When connections are not being returned to the pool.

fix
-- Identify all connections from this user:
SELECT * FROM information_schema.PROCESSLIST WHERE USER = 'appuser';

Why this works

Use try-with-resources or connection pool management to guarantee connections are closed after use.

Sources

📚 Official docs: https://mariadb.com/kb/en/alter-user/#resource-limit-options

🔧 Source ref: MariaDB Server error code 1203 / ER_TOO_MANY_USER_CONNECTIONS

📖 Further reading: MariaDB ALTER USER Resource Limits

Confidence assessment

✅ HIGH confidence

Stable.

See also

🔗 Related errors

📄 Reference pages

max_user_connectionsALTER USERSHOW PROCESSLIST
⚙️ This error reference was generated with AI assistance and reviewed for accuracy. Examples are provided to illustrate common scenarios and may not cover every case. Always test fixes in a development environment before applying to production. Spotted an error? Suggest a correction →