max_connections 与 max_used_connections --ERROR 1040: Too many connections

mysql> show variables like 'max_connections';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_connections | 151   |
+-----------------+-------+
1 row in set (0.03 sec)

mysql> show global status like 'max_used_connections';
+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| Max_used_connections | 1     |
+----------------------+-------+
1 row in set (0.19 sec)

secureCRT在打开一个窗口 mysql -uroot -p 登陆
mysql
> show global status like 'max_used_connections'; +----------------------+-------+ | Variable_name | Value | +----------------------+-------+ | Max_used_connections | 2 | +----------------------+-------+ 1 row in set (0.01 sec)


MySQL比较理想的最大连接数计算方式为:

 

posted @ 2016-06-22 17:53  zengkefu  阅读(879)  评论(0编辑  收藏  举报