我在 /etc/my.cnf
中修改了
max_connections = 2000
mysql> show variables like "max_connections"; +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 214 | +-----------------+-------+ 1 row in set
我的系统是 CentOS 7.1,MySQL 5.6.25,
安装方式是安装官方提供的默认安装方式
http://www.waylau.com/centos-7-install-mysql/
另外,主机的内存是2G。
Edit file /usr/lib/systemd/system/mysqld.service
Add at end:
LimitNOFILE=65535
LimitNPROC=65535
$ systemctl daemon-reload
$ systemctl restart mysqld.service