mysql---连接数太多 (1040 too many connection),调大连接 (亲测有用)

解决问题:mysql 1040 too many connections

当项目mysql数据库连接太多-报错--1040 too many connection

重启mysql 服务器 (systemctl restart mysqld.service)

1、mysql -u root -p 回车输入密码进入mysql

2、执行show variables like "max_connections"; (查询当前的最大连接数)

 3、执行set GLOBAL max_connections=10000; (修改最大连接数)

 4、执行show variables like "max_connections";  

此时就解决了!

注意:mysql服务器重启之后就会恢复默认的最大连接!

《任何事都是有可能的。所以别放弃,相信自己,你可以做到的。---->> 闯 !》
原文地址:https://www.cnblogs.com/dingchuang666/p/14439889.html