最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

解析mysql中max_connections与max_user_connections的区别_MySQL

来源:动视网 责编:小采 时间:2020-11-09 18:55:00
文档

解析mysql中max_connections与max_user_connections的区别_MySQL

解析mysql中max_connections与max_user_connections的区别_MySQL:bitsCN.com 在mysql的手册中已经对max_user_connections有一点说明,它是用来限制用户资源的,怎么限制用户资源呢?这里做了个小测试。首先产看该全局变量的值mysql> select @@max_user_connections;+----------------------
推荐度:
导读解析mysql中max_connections与max_user_connections的区别_MySQL:bitsCN.com 在mysql的手册中已经对max_user_connections有一点说明,它是用来限制用户资源的,怎么限制用户资源呢?这里做了个小测试。首先产看该全局变量的值mysql> select @@max_user_connections;+----------------------


bitsCN.com 在mysql的手册中已经对max_user_connections有一点说明,它是用来限制用户资源的,怎么限制用户资源呢?这里做了个小测试。
首先产看该全局变量的值
mysql> select @@max_user_connections;
+------------------------+
| @@max_user_connections |
+------------------------+
| 0 |
+------------------------+
1 row in set (0.00 sec)
默认情况系是为0的
为0是什么意思呢?它是说不限制用户资源的。
在这里我改变一下它的值,并在查询,注意这改变在服务器重启后无效,想一直保存的话就放在选项文件里面!
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)
现在我重新开启一个连接
C:/Windows/System32>mysql -uroot -pweb
ERROR 1203 (42000): User root already has more than 'max_user_connections' activ
e connections
意思是这个用户已经达到最大的连接数,不能再连接拥有资源!
该参数只能对整体限制资源,不能对某个用户进行限制,如果需要对某个用户限制的话,你可以在权限表里面看到
max_questions: 0
max_updates: 0
max_connections: 0
max_user_connections: 0
这几个参数可以对某个用户进行限制。
max_connections 的意思是对整个服务器的用户限制!
bitsCN.com

文档

解析mysql中max_connections与max_user_connections的区别_MySQL

解析mysql中max_connections与max_user_connections的区别_MySQL:bitsCN.com 在mysql的手册中已经对max_user_connections有一点说明,它是用来限制用户资源的,怎么限制用户资源呢?这里做了个小测试。首先产看该全局变量的值mysql> select @@max_user_connections;+----------------------
推荐度:
标签: 资源 用户 mysql
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top