mysql突然出现很多unauthenticated user 处于login状态

show processlist 出现很多

unauthenticated user | connecting host | NULL | Connect | 179 | login

出现这种情况很大可能是因为DNS导致的,可以通过跳过dns解析skip-name-resolve来解决

进一步查看日志

也有可能是back_log值打满了。

back_log:如果MySql的连接数据达到max_connections时,新来的请求将会被存在堆栈中,以等待某一连接释放资源,该堆栈的数量即back_log,如果等待连接的数量超过back_log,将不被授予连接资源。将会报:unauthenticated user | xxx.xxx.xxx.xxx | NULL | Connect | NULL | login | NULL 的待连接进程时back_log值不能超过TCP/IP连接的侦听队列的大小。

查看错误日志

[ERROR] Threadpool could not create additional thread to handle queries, because the number of allowed threads was reached. Increasing 'thread_pool_max_threads' parameter can help in this situation.

线程池满了,连接池也打满。将unauthenticated user杀掉

for id in `mysqladmin -uroot -p"pass" processlist|grep -i "unauthenticated"|awk '{print $2}'`
do
        mysqladmin -uroot -p"pass" kill ${id}
done

mysql -uroot -p -S /tmp/mysql.sock -e "select * from information_schema.processlist where USER  in('unauthenticated user')  and command !='sleep' and time >100" | awk '{print "kill " $1 ";"}'>/tmp/a.txt
source  /tmp/a.txt;   

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值