Mysql 连接数过大或常常连接超时的排错方法

进入数据库安装的linux,

进入mysql
mysql -uroot进入mysql 查看设定的最大连接数
show variables like '%max_connections%';

查看使用的量,实时统计
show global status like 'Max_used_connections';

修改最大连接数,重启后失效
set GLOBAL max_connections=10000;

要查出那个ip或那个微服务占用太多资源,用mysql客户端进入information_schema数据库查看
依照ip查看使用情况
select SUBSTRING_INDEX(host,':',1) as ip , count(*) from information_schema.processlist group by ip;

依照服务名查看使用情况
SELECT  count(*),db from information_schema.processlist group by db
--------------------- 
原文:https://blog.csdn.net/howard789/article/details/87193130 
 

猜你喜欢

转载自blog.csdn.net/shixiansen6535/article/details/89537648
今日推荐