第31章 MySQL最多只允许214个连接 - xiaoboluo768/qianjinliangfang GitHub Wiki
mysql> show variables like 'max_connections';
......
1 row in set (0.00 sec)
mysql> show variables like 'max_connections'\G
......
1 row in set (0.01 sec)
mysql> set global max_connections=800\G
Query OK, 0 rows affected (0.00 sec)
[root@localhost~]# ulimit -a
......
[root@localhost~]# ps -ef|grep '\<mysqld\>'
......
[root@localhost~]# cat /proc/28192/limits
......
- 1.MySQL在线修改最大连接数
mysql> set global max_connections=800\G
Query OK, 0 rows affected (0.00 sec)
- 2.Linux提高进程最大文件句柄数限制
[root@localhost~]# ulimit -HSn 65535
[root@localhost~]# cat /etc/security/limits.conf
...
* soft nofile 65535
* hard nofile 65535
...
[root@localhost~]# cat /etc/rc.local
...
/etc/init.d/sshd stop
ulimit -HSn 65535
/etc/init.d/sshd start
...
- 1.ulimit命令
[root@localhost~]# ulimit -a
......
上一篇:第29章 MySQL连接无法自动释放 | 下一篇:第32章 MySQL挂起诊断思路