[摘要]+-----------------+-------+这是由于mariadb有默认打开文件数限制。可以通过配置/usr/lib/systemd/system/mariadb.service来调大打开...
+-----------------+-------+
这是由于mariadb有默认打开文件数限制。可以通过配置/usr/lib/systemd/system/mariadb.service来调大打开文件数目。
配置/usr/lib/systemd/system/mariadb.service
[Service]新添加两行如下参数:
LimitNO
FILE
=10000
LimitNPROC=10000
重新加载系统服务,并重启mariadb服务
systemctl --system daemon-reload
systemctl restart mariadb.service
再次查看mariadb数据库最大连接数,可以看到最大连接数已经是1000
MariaDB [(none)]> show variables like 'max_connections';
+-----------------+-------+
关键词:详细介绍mysql连接数设置设置办法(Too many connections)