mysql修改max_connections
2019-10-22mysql超过最大连接数。
1、show variables like '%conn%'
默认是151
修改/etc/my.cnf
max_connections=300
2、启动后发现
show variables like '%conn%'
默认是214
3、--ulimit nofile=65536:65536
mysql hard nofile 65535
mysql soft nofile 65535
vi /etc/security/limits.conf
4、vi /usr/lib/systemd/system/mysqld.service
LimitNOFILE=65535
LimitNPROC=65535
systemctl daemon-reload
systemctl restart mysqld.service
5、set
set GLOBAL max_connections=300;
show variables like 'max_connections';
SELECT @@MAX_CONNECTIONS;