Centos7下永久修改mysql5.6最大连接数

1、安装好mysql服务

2、编辑mysql配置文件

vim /etc/my.cnf
3、在[mysqld]分段下添加一行:

max_connections=65535
 4、编辑 /etc/systemd

vim /etc/systemd/system.conf

打开注释,并修改值为65535:
DefaultLimitNOFILE=65535
DefaultLimitNPROC=65535
————————————————

修改了system.conf后,需要重启系统才会生效。

5、重启使mysql配置生效

  1. systemctl daemon-reload

  2. systemctl restart mysqld.service

6、查看连接数

 第一种:命令行查看和修改最大连接数(max_connections)。

  >mysql -uuser -ppassword(命令行登录MySQL)

  mysql>show variables like 'max_connections';(查可以看当前的最大连接数)
————————————————

原文地址:https://www.cnblogs.com/cyrusxx/p/12615737.html