max_user_connections参数设置试验
2016-06-04 18:05
344 查看
--查看当前max_user_connections连接参数值为0,表示没有限制. mysql> show global variables like '%connect%'; +--------------------------+-----------------+ | Variable_name | Value | +--------------------------+-----------------+ | character_set_connection | utf8 | | collation_connection | utf8_general_ci | | connect_timeout | 10 | | init_connect | | | max_connect_errors | 10 | | max_connections | 160 | | max_user_connections | 0 | +--------------------------+-----------------+ 7 rows in set (0.00 sec) --设置max_user_connections值为2 mysql> set global max_user_connections=2; Query OK, 0 rows affected (0.00 sec) --查看设置是否生效 mysql> show global variables like '%connect%'; +--------------------------+-----------------+ | Variable_name | Value | +--------------------------+-----------------+ | character_set_connection | utf8 | | collation_connection | utf8_general_ci | | connect_timeout | 10 | | init_connect | | | max_connect_errors | 10 | | max_connections | 160 | | max_user_connections | 2 | +--------------------------+-----------------+ 7 rows in set (0.00 sec) --退出数据库 mysql> exit Bye --登录数据库 C:\Users\ArcerZhang>mysql -uroot -parcerzhang Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.5.28 MySQL Community Server (GPL) Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. --查看数据库 mysql> show global variables like '%connect%'; +--------------------------+-----------------+ | Variable_name | Value | +--------------------------+-----------------+ | character_set_connection | utf8 | | collation_connection | utf8_general_ci | | connect_timeout | 10 | | init_connect | | | max_connect_errors | 10 | | max_connections | 160 | | max_user_connections | 2 | +--------------------------+-----------------+ 7 rows in set (0.00 sec) mysql>
二、登录第一个窗口
C:\Users\ArcerZhang>mysql -uroot -parcerzhang Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 5.5.28 MySQL Community Server (GPL) Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
三、登录第二个窗口
C:\Users\ArcerZhang>mysql -uroot -parcerzhang ERROR 1203 (42000): User root already has more than 'max_user_connections' active connections C:\Users\ArcerZhang>
四、结论
当max_user_connections设置为2时,使用一个用户登录mysql server,当开启第二窗口登录时,就会报错了.而且第一个试验窗口也算是一个用户登录.相关文章推荐
- 细聊冗余表数据一致性
- Hadoop集群应用于大数据分析优势和挑战
- 关于Fragment中viewpager的子fragment不能加载布局的问题
- jQuery实现 全选/全不选
- 软件下载站
- python学习 函数
- Android中的AlarmManager的使用
- linux基本命令(56)——netstat命令
- PowerPoint 2007双显示输出技巧
- Android5.1系统外部存储和U盘可写解决方案
- HashMap & Hashtable区别
- 剑指offer(三十九)之连续子数组的最大和
- 双边滤波(Bilateral filter)
- Java clone() 浅克隆与深度克隆
- Java clone() 浅克隆与深度克隆
- QSharedMemory类
- 前置和后置++运算符的重载
- C#如何在派生类中不显示父类的一些属性以及TypeDescriptor使用
- 使用定时任务运行powershell脚本
- LeetCode-200.Number of Islands