1204
MariaDBERRORCommonConnectionHIGH confidence

User already has more than max_user_connections active connections

Production Risk

Medium — legitimate application connections are refused.

What this means

ER_TOO_MANY_USER_CONNECTIONS (1204, SQLSTATE HY000) is raised when a specific user account attempts to open more simultaneous connections than allowed by their MAX_USER_CONNECTIONS privilege or the global max_user_connections variable.

Why it happens
  1. 1Application opening too many connections without closing them
  2. 2Connection pool misconfiguration leaking connections
  3. 3max_user_connections set too low for the user account
How to reproduce
trigger — this will error
trigger — this will error
-- Connecting as user with MAX_USER_CONNECTIONS = 2
-- Third connection attempt:
mysql -u limited_user -p  -- ERROR 1204

expected output

ERROR 1204 (HY000): User limited_user already has more than 'max_user_connections' active connections

Fix 1

Increase per-user connection limit

Increase per-user connection limit
ALTER USER 'limited_user'@'%' WITH MAX_USER_CONNECTIONS 20;

Why this works

Raises the connection limit for the specific user.

Fix 2

Increase global max_user_connections

Increase global max_user_connections
SET GLOBAL max_user_connections = 50;

Why this works

Applies to all users without a specific per-account limit.

Sources
Official documentation ↗

MySQL 8.0 — 1204 ER_TOO_MANY_USER_CONNECTIONS

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors