We all know that:
max_connections refers to the total number of connections that all clients can create on mysql instance simultaneously.
And max_user_connections refers to the total number of connections that user can create simultaneously.
So why there is separate column named max_connections for all users in mysql.user table? Because max_connections is the same for all users and is a global variable for all the connections?
From the MySQL Reference Manual:
MySQL permits limits for individual accounts on use of these server resources:
- The number of queries an account can issue per hour
- The number of updates an account can issue per hour
- The number of times an account can connect to the server per hour
- The number of simultaneous connections to the server by an account
... The server stores resource limits for an account in the user table row corresponding to the account. The
max_questions
,max_updates
, andmax_connections
columns store the per-hour limits, and themax_user_connections
column stores theMAX_USER_CONNECTIONS
limit.