欢迎光临
我们一直在努力

mysql: Error 1040: Too many connections

Error 1040: Too many connections

登录 mysql 查看 conn连接数配置
MySQL [(none)]> show variables like '%max_connections%';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| extra_max_connections | 1     |
| max_connections       | 512  |
+-----------------------+-------+
2 rows in set (0.00 sec)



MySQL [(none)]> show global status like 'Max_used_connections';
+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| Max_used_connections | 513   |
+----------------------+-------+
1 row in set (0.00 sec)
  • max_connections 是mysql最大连接数
  • Max_used_connections 历史使用最大连接数
可以看到 Max_used_connections 513 以超过 max_connections 512
修改配置文件, my.conf 等待下次重启
max_connections                         = 4096
max_user_connections                    = 4096
如果不想重启可以登录mysql直接修改
MySQL [(none)]> set GLOBAL max_connections=4096;
Query OK, 0 rows affected (0.00 sec)


MySQL [(none)]> show variables like '%max_connections%';
+-----------------------+-------+
| Variable_name         | Value |
+-----------------------+-------+
| extra_max_connections | 1     |
| max_connections       | 4096  |
+-----------------------+-------+
2 rows in set (0.00 sec)
赞(3) 打赏
转载请注明来源:IT技术资讯 » mysql: Error 1040: Too many connections

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏