mysql配置文件my.cnf添加max_connections不生效

发布时间 2023-10-16 16:02:58作者: xuzhujack
1、my.cnf设置了max_connections = 2000,但是查看最大连接数是214

2、解决办法
添加LimitNOFILE=65535到mysql服务文件mysqld.service中的[Service]段里面
vi /lib/systemd/system/mysqld.service

3、重启服务然后查看

数据库最大连接数
show variables like '%max_connections%';

使用的最大连接数
show global status like 'Max_used_connections';

使用的线程情况
show status like 'Threads%';

4、显示用户正在运行的线程
show processlist;

5、数据库性能状态
1)QPS量
Com_select:MySQL从上一次启动到当前所执行的查询语句总数量
show global status where variable_name='Com_select';

2)TPS量
Com_commit:MySQL从上一次启动到当前所执行的提交语句总数量
show global status where variable_name='Com_commit';

转发原文链接:https://blog.csdn.net/csj50/article/details/131422499