max_user_connections与max_connections
来源:互联网 发布:淘宝网包包新款男士 编辑:程序博客网 时间:2024/04/27 13:55
max_user_connections针对单一用户
max_connections针对所有用户
用一个脚本可以验正
cat test.sh
mysql -uroot -p3306 -e "show variables like '%max%connections'"for i in {1..4}domysql -utest -ptest -e "select sleep(1),sysdate(),user(),'$i'" &mysql -uroot -p3306 -e "select sleep(1),sysdate(),user(),'$i'" &done
sh test.sh
Warning: Using a password on the command line interface can be insecure.+----------------------+-------+| Variable_name | Value |+----------------------+-------+| max_connections | 151 || max_user_connections | 3 |+----------------------+-------+Warning: Using a password on the command line interface can be insecure.Warning: Using a password on the command line interface can be insecure.Warning: Using a password on the command line interface can be insecure.Warning: Using a password on the command line interface can be insecure.Warning: Using a password on the command line interface can be insecure.[root@o11204 tmp]# Warning: Using a password on the command line interface can be insecure.Warning: Using a password on the command line interface can be insecure.Warning: Using a password on the command line interface can be insecure.ERROR 1203 (42000): User root already has more than 'max_user_connections' active connectionsERROR 1203 (42000): User test already has more than 'max_user_connections' active connections+----------+---------------------+----------------+---+| sleep(1) | sysdate() | user() | 3 |+----------+---------------------+----------------+---++----------+---------------------+----------------+---+| 0 | 2015-03-10 12:32:39 | root@localhost | 3 |+----------+---------------------+----------------+---+| sleep(1) | sysdate() | user() | 4 |+----------+---------------------+----------------+---+| 0 | 2015-03-10 12:32:39 | root@localhost | 4 |+----------+---------------------+----------------+---+sleep(1)sysdate()user()302015-03-10 12:32:39test@localhost3+----------+---------------------+----------------+---+| sleep(1) | sysdate() | user() | 2 |+----------+---------------------+----------------+---+| 0 | 2015-03-10 12:32:39 | root@localhost | 2 |+----------+---------------------+----------------+---+sleep(1)sysdate()user()202015-03-10 12:32:39test@localhost2sleep(1)sysdate()user()402015-03-10 12:32:39test@localhost4
可以看到当第四次连接时不管root还是test用户都报错,而这时总用户已超过了3个
而由上面的例子也可以看到,后台程序执行的先后顺序,与脚本里发出的顺序不一样
在这儿 i=1 是最后一次执行,所以没出结果
0 0
- max_user_connections与max_connections
- 解析mysql中max_connections与max_user_connections的区别
- mysql 的max_connections和max_user_connections 的区别
- mysql 的max_connections和max_user_connections 的区别
- mysql调整max_connections和max_user_connections及php模拟并发测试
- mysql max_connections
- greenplum max_connections 参数疑惑
- MySQL的max_connections
- mysql 修改max_connections
- mysql max_connections 最大连接数
- 合理设置max_user_connections以避免MySQL宕机
- window mysql修改最大连接数max_connections
- 【MySql】修改max_connections 参数的方法
- mysql数据库参数innodb_buffer_pool_size和max_connections
- 一次max_connections失效的问题分析
- User perf_inventory already has more than 'max_user_connections' active connections
- sql server 2005 T-SQL @@MAX_CONNECTIONS (Transact-SQL)
- linux mysql下 从 max_connections 的实验带来的思考
- 2015年3月7日
- 了解如何通过reverse_iterator的base得到iterator
- 《TCP/IP详解》读书笔记(20章)-TCP的成块数据流
- 格式转换工具
- 机房收费--报表设计
- max_user_connections与max_connections
- libgdx 环境搭建
- MinGW下载安装
- 初遇SOCKET套接字(socket基本概念)
- 交换变量,找出三个中的中间那位
- MAC下安装HOMEBREW
- Android学习—ListView的使用(二)
- VBScript函数--数学函数
- 队列的出队/入队的操作