手机看片精品高清国产日韩,色先锋资源综合网,国产哺乳奶水91在线播放,乱伦小说亚洲色图欧洲电影

幫助中心 >  技術(shù)知識庫 >  數(shù)據(jù)庫 >  相關(guān)技術(shù)支持 >  如何處理: Can not connect to MySQL server. Too many connections

如何處理: Can not connect to MySQL server. Too many connections

2018-08-05 17:07:52 13849

MySQL報錯Can not connect to MySQL server. Too many connections,報錯很明確,與MySQL的連接數(shù)滿了。mysql最大連接數(shù)默認(rèn)為100,看來有必要改大一點了。

方法:修改配置,然后重啟

vi /etc/m.cnf加入max_connections=1024,然后重啟mysql即可。

需要注意的是有時候重啟后max_connections變成了214,這就很詭異了。
查閱了官方文檔:

The maximum number of connections MySQL can support depends on the quality of the thread library on a given platform, the amount of RAM available, how much RAM is used for each connection, the workload from each connection, and the desired response time. Increasing open-files-limit may be necessary. Also see Section 2.5, “Installing MySQL on Linux”, for how to raise the operating system limit on how many handles can be used by MySQL.

 

把上述語句概括起來就是,max_connections依托于操作系統(tǒng),Linux系統(tǒng)必要時需要增加open-files-limit。萬萬沒想到啊,修改max_connections竟然要修改操作系統(tǒng)最大文件描述符。

vi /usr/lib/systemd/system/mysqld.service加入

LimitNOFILE=50000

重啟MySQL


提交成功!非常感謝您的反饋,我們會繼續(xù)努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問題: