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';

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