mysql连接数问题备份

时间:2022-02-28 01:43:51

 

这是是查询数据库当前设置的最大连接数 mysql> show variables like ‘%max_connections%‘;
----------------- -------
| Variable_name   | Value |
----------------- -------
| max_connections | 1000  |
----------------- -------     可以在/etc/my.cnf里面设置数据库的最大连接数 [mysqld] max_connections = 1000   重启mysql即生效     临时修改连接数上限 set global max_connections=1000 重启后失效    

#详细连接信息
show full processlist;

 

实战:

 

vim /opt/lampp/etc/my.cnf 

 

 

#add by chong

max_connections = 1000

 

/opt/lampp/lampp stopmysql

 

/opt/lampp/lampp startmysql