Centos7 修改mysql5.7最大连接数

版本:centos7,mysql5.7

1.编辑mysql配置文件


//编辑mysql配置文件
vim /etc/my.cnf

//在[mysqld]下添加
max_connections=10000

2.编辑mysqld.service配置文件


//编辑/usr/lib/systemd/system/mysqld.service配置文件
vi /usr/lib/systemd/system/mysqld.service

//在尾部添加
LimitNOFILE=65535
LimitNPROC=65535

3.重启mysql服务,使配置生效


systemctl daemon-reload
systemctl restart mysqld.service

4.查询当前最大连接数


//查询最大连接数
show variables like "max_connections"; 
//当前使用连接数
show global status like 'Max_used_connections';

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章