MySQL - 報錯 Changed limits max_connections ( error 214 ) 解决方法
Published in:2022-12-14 | category: MySQL

error 214 —- Buffered warning: Changed limits: max_connections



修改系統 Kernel 的變數

vim /etc/sysctl.conf
net.ipv4.tcp_syncookies: 1

net.ipv4.tcp_tw_reuse: 1

net.ipv4.tcp_tw_recycle: 1
  
net.ipv4.tcp_fin_timeout: 30


修改系統資源限制配置文件

vim /etc/security/limits.conf 
* soft nproc 65535

* hard nproc 65535

* soft nofile 65535

* hard nofile 65535  


將mysql默認資源限制拉高 (默認為5000)

vim /usr/lib/systemd/system/mysqld.service
    
LimitNOFILE=65535





Prev:
GCP - 無痛轉移帳單免費額度
Next:
Nginx - Proxypass (範例)