参考链接

链接:https://blog.csdn.net/ZhiyouWu/article/details/53837897

Mysql 连接数过高

查看位置1 -> 实例会话

image.png
能够看到连接数的前八:
image.png

查看位置2

数据库实例点进来,查看监控与报警。
image.png

image.png

代码层面

代码层面会返回 connection refused , 拒绝连接。
dial tcp 47.103.175.155:80: connect: connection refused“,”time“:”2019-11-28T20:32:16+08:00“}

kill 某个 ip 的连接

参考链接:

  1. select concat('KILL ',id,';') from information_schema.processlist where host like '%172.19.32.144%';

这时就可以显示出开多个账号的好,可以再加上 user 和 db 的限制,能够防止误杀:

select concat('KILL ',id,';') from information_schema.processlist where user='root' 
and db='tunicorn' and host like '172.16.1.105%';