MySQL max_user_connections vs max_connections

[英]MySQL max_user_connections vs max_connections

SADLY i could not find any straight-forward explanation to this query anywhere, not even in MySQL documentations.


Some people in various forums said max_user_connections can never be greater than max_connections? For example: if one user has 3 max_user_connections and another user has 15 max_user_connections, then they say the max_connections must be at least above 3+15 = 18.

各種論壇中的一些人說max_user_connections永遠不會超過max_connections?例如:如果一個用戶有3個max_user_connections而另一個用戶有15個max_user_connections,那么他們說max_connections必須至少高於3 + 15 = 18。

However, mysql doc says, max allowed value of max_user_connections is 4294967295 which is MUCH LARGER THAN the max allowed value of max_connections is 100000.

但是,mysql doc說,max_user_connections的最大允許值是4294967295,這比max_connections的最大允許值為100000要大得多。

Can somebody please explain how do these two options in MySQL impact one another.


1 个解决方案



One means of restricting client use of MySQL server resources is to set the global max_user_connections system variable to a nonzero value. This limits the number of simultaneous connections that can be made by any given account, but places no limits on what a client can do once connected. In addition, setting max_user_connections does not enable management of individual accounts. Both types of control are of interest to MySQL administrators.

限制客戶端使用MySQL服務器資源的一種方法是將全局max_user_connections系統變量設置為非零值。這限制了任何給定帳戶可以同時進行的連接數,但對連接后客戶端可以執行的操作沒有限制。此外,設置max_user_connections不會啟用個人帳戶的管理。 MySQL管理員都對這兩種控件都很感興趣。


The maximum permitted number of simultaneous client connections. By default, this is 151


comment by dagon :


max_connections = the total connection limit
max_user_connections = the per user limit

max_connections =總連接限制max_user_connections =每個用戶限制

Hence, the value of max_user_connections must never exceed the value of max_connections.




粤ICP备14056181号  © 2014-2021