max_connections 与 max_used_connections --ERROR 1040: Too many connections
Posted zengkefu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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比较理想的最大连接数计算方式为:
1
|
max_used_connections / max_connections * 100% ≈ 85%
|
以上是关于max_connections 与 max_used_connections --ERROR 1040: Too many connections的主要内容,如果未能解决你的问题,请参考以下文章
PostgreSQL--信号量和shmall 和 shmmax相关设置
MySQL 最大连接数(max_connections)上限214问题