最近mysql的一個參數max_connections參數總是變爲214,my.cnf中的參數,控制檯修改,都無法生效。
最後經過檢查發現,是因爲open files還是默認的參數1024,修改/etc/security/limits.conf文件,添加一下內容
* soft nofile 102400
* hard nofile 102400
保存退出。
然後,重新連接服務器(退出ssh重新登錄),然後重啓mysql。
這時,重新進入控制檯檢查max_connections參數,發現問題已解決。