MySQL 默认的最大连接数为 151
- mysql> show variables like 'max_connections';
- +-----------------+-------+
- | Variable_name | Value |
- +-----------------+-------+
- | max_connections | 151 |
- +-----------------+-------+
设置这个最大连接数值 mysql> set GLOBAL max_connections=512;
或 vim /etc/my.cnf[mysqld]max_connections=512
查看服务器响应的最大连接数:
- show global status like 'Max_used_connections';
- +----------------------+-------+
- | Variable_name | Value |
- +----------------------+-------+
- | Max_used_connections | 95 |
- +----------------------+-------+
来源: http://www.bubuko.com/infodetail-2744036.html