“Too many connections” max_connections | 214 mysql 解决方法.
项目中,由于连接数过多,提示“Too many connections”,需要增加连接数。我在 /etc/my.cnf中修改了
max_connections = 3000
但是, 一直都是显示的 214
mysql> show variables like "max_connections";
+—————–+——-+
| Variable_name | Value |
+—————–+——-+
| max_connections | 214 |
+—————–+——-+
1 row in set+
修改 /usr/lib/systemd/system/mariadb.service
LimitNOFILE=65535
LimitNPROC=65535
systemctl status mariadb
Warning: mariadb.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
Hint: Some lines were ellipsized, use -l to show in full.
systemctl daemon-reload
systemctl restart mariadb
show variables like ‘%max_connections%’;
extra_max_connections 1
max_connections 3000 —恢复和配置一样
http://dev.mysql.com/doc/refman/5.7/en/too-many-connections.html
http://www.oschina.net/question/853151_241231
暂时还木有人评论,坐等沙发!