MySQL Error 1226: User Limit Reached
Fix MySQL Error 1226 by identifying the account’s hourly query, update, or connection quota, then correcting the workload or account limit.
On this page
MySQL Error 1226 (42000, ER_USER_LIMIT_REACHED) means an account exceeded a configured resource limit. The message names the resource, such as max_questions, max_updates, or max_connections, and includes its current value. Read that resource name before changing a setting. See the MySQL 8.4 error reference.
This error usually concerns a per-hour quota. It is different from Error 1203, which normally means the account reached its simultaneous-connection limit, and Error 1040, which means the server reached the global connection limit. MySQL documents a transient disconnect/reconnect edge case where the simultaneous limit can briefly return Error 1226 instead of 1203; see MySQL account resource limits.
Identify which account resource was exceeded
The error message names the exhausted resource. From an administrative connection, inspect the candidate account rows:
SELECT
User,
Host,
max_questions,
max_updates,
max_connections,
max_user_connections
FROM mysql.user
WHERE User = 'app_user';
Replace app_user with the user named in the error, then identify the User@Host account that matched the client. This query requires appropriate administrative access; do not grant application users access to the mysql system schema just for diagnosis.
The account columns represent different limits:
| Account column | What it limits |
|---|---|
max_questions |
Queries issued per hour |
max_updates |
Statements that modify databases or tables per hour |
max_connections |
New connections per hour for that account; this is not the global server variable |
max_user_connections |
Simultaneous connections for that account; normally associated with Error 1203, though a rapid reconnect can briefly return 1226 |
Limits are applied to the matching account row and shared across clients that use that account. A pool with many workers or application replicas can therefore consume a quota faster than one process alone suggests.
Review workload and account settings
Check which jobs, application instances, health checks, and retries use the account. Reduce accidental query or connection bursts, and fix retry loops before raising a quota. If the limit is intentional, adjust only the specific resource needed for the identified account with ALTER USER; the account resource limit documentation shows the supported WITH MAX_... options.
MySQL counts per-hour resource use over a one-hour period. An administrator can reset all accounts’ per-hour resource indicators with FLUSH USER_RESOURCES, but that immediately allows every account whose hourly quota was exhausted to resume. Use it only as a deliberate administrative recovery action after identifying the cause; it does not change the configured quota and does not reset the simultaneous-connection cap. The statement requires FLUSH_USER_RESOURCES or RELOAD; see the FLUSH statement reference.
If the error names max_user_connections and occurs immediately after a connection closes, the server may still be processing that disconnect. MySQL notes that a rapid reconnect can briefly return Error 1226 or 1203 at the account’s simultaneous-connection cap. Avoid a tight retry loop and follow the Error 1203 connection-count checks.
Distinguish Error 1226 from connection-count limits
- Error 1226: the error names an account resource that was exceeded, commonly an hourly query, update, or connection quota.
- Error 1203: the account reached its simultaneous-connection limit; see MySQL Error 1203.
- Error 1040: the server reached its global
max_connectionslimit; see MySQL Error 1040.
For other account, connection, and SQL failures, browse MySQL Error Troubleshooting.