--View the current max_user_connections connection parameter value of 0, which means there is no limit.
Mysql>Show global variables like '%connect%';+--------------------------+-----------------+|Variable_name|Value|+--------------------------+-----------------+|Character_set_connection|Utf8||Collation_connection|Utf8_general_ci||Connect_timeout| Ten ||Init_connect| ||Max_connect_errors| Ten ||Max_connections| the ||Max_user_connections| 0 |+--------------------------+-----------------+7Rowsinch Set(0.00sec) --Set max_user_connections value to 2MySQL> SetGlobal Max_user_connections=2; Query OK,0Rows Affected (0.00sec) --Check if the settings are active MySQL>Show global variables like '%connect%';+--------------------------+-----------------+|Variable_name|Value|+--------------------------+-----------------+|Character_set_connection|Utf8||Collation_connection|Utf8_general_ci||Connect_timeout| Ten ||Init_connect| ||Max_connect_errors| Ten ||Max_connections| the ||Max_user_connections| 2 |+--------------------------+-----------------+7Rowsinch Set(0.00sec) --quit database MySQL> ExitBye--Login database C:\Users\ArcerZhang>Mysql-Uroot-Parcerzhangwelcome toThe MySQL Monitor. CommandsEnd with;or\g.your MySQL Connection ID is 7Server Version:5.5. -MySQL Community Server (GPL) Copyright (c) -, -, Oracleand/orits affiliates. Allrights reserved. Oracle isA registered trademark ofOracle Corporationand/oritsaffiliates. Names may trademarks oftheir respectiveowners. Type'Help ;' or '\h' forHelp. Type'\c' toClear the Currentinput statement. --View database MySQL>Show global variables like '%connect%';+--------------------------+-----------------+|Variable_name|Value|+--------------------------+-----------------+|Character_set_connection|Utf8||Collation_connection|Utf8_general_ci||Connect_timeout| Ten ||Init_connect| ||Max_connect_errors| Ten ||Max_connections| the ||Max_user_connections| 2 |+--------------------------+-----------------+7Rowsinch Set(0.00sec) MySQL>
Second, login to the first window
C:\Users\ArcerZhang>Mysql-Uroot-Parcerzhangwelcome toThe MySQL Monitor. CommandsEnd with;or\g.your MySQL Connection ID is 8Server Version:5.5. -MySQL Community Server (GPL) Copyright (c) -, -, Oracleand/orits affiliates. Allrights reserved. Oracle isA registered trademark ofOracle Corporationand/oritsaffiliates. Names may trademarks oftheir respectiveowners. Type'Help ;' or '\h' forHelp. Type'\c' toClear the Currentinput Statement.mysql>
Third, login to the second window
C:\Users\ArcerZhang>-1203 (42000User' max_user_connections' active Connectionsc:\users\arcerzhang>
Iv. Conclusion
When Max_user_connections is set to 2 o'clock, log in to MySQL server with a user, and when the second window is turned on, the error will be made. and the first Test window is a user login.
Max_user_connections parameter Setting test