当项目mysql数据库连接太多-报错--1040 too many connection
解决问题:mysql 1040 too many connections
重启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";

此时就解决了!
永久生效配置修改配置文件 :
/etc/mysql/mysql.conf.d/mysqld.cnf
添加:
max_connections = 2000

浙公网安备 33010602011771号