Search code examples
mysqllinuxmysql-error-1064mysql-5.7

What's the use of max_connections column in mysql.user table?


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?


Solution

  • 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, and max_connections columns store the per-hour limits, and the max_user_connections column stores the MAX_USER_CONNECTIONS limit.