Is a only a USER or connection to access the database, as used in MULTI USER and SINGLE USER mode,
CodePudding user response:
A user, you can directly set user permissions, if multiple users, is the current can only connect one that don't know how to doCodePudding user response:
Max_connections is set to 1, so only allow a connection to connect to the database
- session1
mysql> Show variables like 'max_connections';
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- +
Value | | Variable_name |
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- +
200 | | max_connections |
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- +
1 row in the set, 1 warning (0.00 SEC)
mysql> The set global max_connections=1;
Query OK, 0 rows affected (0.00 SEC)
mysql>
mysql> Show variables like 'max_connections';
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- +
Value | | Variable_name |
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- +
| | max_connections | 1
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- +
1 row in the set, 1 warning (0.00 SEC)
- the session 2
C: \ & gt; Mysql - uroot - p
Enter password: * * * * * *
ERROR 1040 (HY000) : Too many connections
CodePudding user response:
Pro, I mean access to the specified database can only have a connection, such as the database connection DB_XXX, only one connection, you modify the number of connections is the server can only be a connection,CodePudding user response: