pool fail to create connection ((conn=-1, no: 1040, SQLState: HY000) Too many connections)
在使用node/express开发后台的时候发现连接数据库失败
服务器为centOS,数据库是mariadb
修改数据库配置:
vim /usr/lib/systemd/system/mariadb.service
在[Service]下面加入以下内容
LimitNOFILE=10000
LimitNPROC=10000
vim /etc/my.cnf
在[mysqld]下,加入以下内容
max_connections=4096
重启数据库
systemctl --system daemon-reload
systemctl restart mariadb.service