本帖最后由 vcdog 于 2014-3-7 11:26 编辑
1.max_connections默认值为2000:(数据库版本为:5.6.13)
在/etc/my.cnf下,添加max_connections=10000,重启数据库,查看日志报警如下:
2014-03-05 16:13:51 3299 [Warning] Buffered warning: Using unique option prefix max-connection instead of max_connections is deprecated and will be removed in a future release. Please use the full name instead.
查询max_connections如下:
mysql>show variables like '%max_connect%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| max_connect_errors | 6000 |
| max_connections | 2000 |
+--------------------+-------+
2 rows in set (0.00 sec)
修改/etc/my.cnf为max-connection=10000,重启数据库问题依然存在报警如下:
2014-03-05 16:18:15 4503 [Warning] Buffered warning: Using unique option prefix max-connection instead of max_connections is deprecated and will be removed in a future release. Please use the full name instead.
查询max_connections如下:
mysql>show variables like '%max_connect%';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| max_connect_errors | 6000 |
| max_connections | 2000 |
+--------------------+-------+
2 rows in set (0.00 sec)
目前,只能通过登录数据库后,进行手动操作:
mysql> set global max_connections=10000;
但是,一旦数据库重启,此参数又恢复默认值2000.问题很奇怪,查询官方文档,只有max_connections这一个参数,解释如下:
max_connections [553]
Command-Line Format --max_connections=#
Option-File Format max_connections
System Variable Name max_connections [553]
Variable Scope Global
Dynamic Variable Yes
Permitted Values
Type numeric
Default 151
Range 1 .. 100000
The maximum permitted number of simultaneous client connections. By default, this is 151. See
Section C.5.2.7, “Too many connections”, for more information.