mysql> show variables like ‘%open_files_limit%‘; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | open_files_limit | 1024 | +------------------+-------+ 1 row in set (0.00 sec)
查看mysql文件打开最大限制;
查看mysql文件打开最大限制;
修改vim /etc/security/limits.conf
* soft nofile 65535 * hard nofile 65535
重新打开ssh窗口,登录,查看设置结果
[root@localhost ~]# ulimit -n 65535
使mysql配置生效有如下两种方式
1、登录mysql,查看连接数,没有变化,还是214,在mysql开机启动服务文件中添加如下配置(infinity是最大的意思)
vim /usr/lib/systemd/system/mysqld.service
LimitNOFILE=infinity
LimitMEMLOCK=infinity
重启mysql
systemctl daemon-reload
systemctl restart mysql
转自:https://www.cnblogs.com/qq931399960/p/10749328.html
原文:https://www.cnblogs.com/turbozhang/p/14097784.html