1203ERRORTier 1 — Safe✅ HIGH confidenceUser has exceeded the max_user_connections resource
🔴 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
- 1The user account has a MAX_USER_CONNECTIONS resource limit set via ALTER USER or GRANT
- 2The global max_user_connections variable is non-zero and the user has reached it
- 3Connection leaks in the application are exhausting the per-user slot
How to reproduce
A user exceeds their per-user connection limit.
-- Check per-user limit:
SELECT user, max_user_connections FROM mysql.user WHERE user = 'appuser';Fix 1: Increase or remove the per-user connection limit
When the limit is artificially low for the workload.
-- 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.
-- 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