Analysis of the difference between Max_connections and max_user_connections in Mysql _mysql
Source: Internet
Author: User
In the MySQL manual has a bit of max_user_connections, it is used to restrict user resources, how to restrict user resources? Here's a little test.
The value of the global variable is first produced Mysql> SELECT @ @max_user_connections;
+------------------------+
| @ @max_user_connections |
+------------------------+
| 0 |
+------------------------+
1 row in Set (0.00 sec)
by default, the system is 0. What does it mean to be 0? It is said to not restrict user resources.
Here I change the value of it, and in the query, note that this change is not valid after the server reboot, you want to save the words are placed in the options file!
Mysql> SET @ @global. Max_user_connections=1;
Query OK, 0 rows Affected (0.00 sec)
Mysql> SELECT @ @max_user_connections;
+------------------------+
| @ @max_user_connections |
+------------------------+
| 1 |
+------------------------+
1 row in Set (0.00 sec)
now I'm going to reopen a connection. C:\windows\system32>mysql-uroot-pweb
ERROR 1203 (42000): User Root already has more than ' max_user_connections ' Activ
E connections
This means that the user has reached the maximum number of connections and can no longer connect to own resources!
This parameter can only restrict resources to the whole, cannot restrict a user, if you need to limit a user, you can see in the permission list
max_questions:0
max_updates:0
max_connections:0
max_user_connections:0
These parameters can be restricted to a user.
max_connections means a user limit for the entire server!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service