Mysql入门解析mysql中max_connections与max_user_connections的
发布时间:2020-12-12 01:30:01 所属栏目:MySql教程 来源:网络整理
导读:《Mysql入门解析mysql中max_connections与max_user_connections的区别》要点: 本文介绍了Mysql入门解析mysql中max_connections与max_user_connections的区别,希望对您有用。如果有疑问,可以联系我们。 在mysql的手册中已经对max_user_connections有一点说
《Mysql入门解析mysql中max_connections与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:WindowsSystem32>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 的意思是对整个服务器的用户限制! (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |