gpt4 book ai didi

解析mysql中max_connections与max_user_connections的区别

转载 作者:qq735679552 更新时间:2022-09-29 22:32:09 26 4
gpt4 key购买 nike

CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.

这篇CFSDN的博客文章解析mysql中max_connections与max_user_connections的区别由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.

在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 的意思是对整个服务器的用户限制! 。

最后此篇关于解析mysql中max_connections与max_user_connections的区别的文章就讲到这里了,如果你想了解更多关于解析mysql中max_connections与max_user_connections的区别的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com