“Too many connections” max_connections | 214 mysql 解決方法.

來源:本站原創 Linux 超過1,059 views圍觀 0條評論

項目中,由于連接數過多,提示“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

文章出自:CCIE那點事 http://www.qdxgqk.live/ 版權所有。本站文章除注明出處外,皆為作者原創文章,可自由引用,但請注明來源。 禁止全文轉載。
本文鏈接:http://www.qdxgqk.live/?p=3593轉載請注明轉自CCIE那點事
如果喜歡:點此訂閱本站
?
?
萌宠夺宝游戏