您的位置:首页 > 其它

max_connections 与 max_used_connections --ERROR 1040: Too many connections

2016-06-22 17:53 471 查看
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比较理想的最大连接数计算方式为:

1

max_used_connections / max_connections * 100% ≈ 85%

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: