ERROR "Host is blocked because of many connection errors; unblock with 'mysqladmin flus

2022/8/22 2:26:52

本文主要是介绍ERROR "Host is blocked because of many connection errors; unblock with 'mysqladmin flus,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

ERROR com.alibaba.druid.pool.DruidDataSource - create connection SQLException,

url: jdbc:mysql://hadoop108:3306/FlinkEtl?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT&useSSL=false,

errorCode 1129,

state HY000
java.sql.SQLException: null,

message from server: "Host '192.168.200.108' is blocked

because of many connection errors;

unblock with 'mysqladmin flush-hosts'"

 

【方法一】
进入数据库将 max_connection_errors 参数调高,
也可以在my.cnf文件中修改不过需要重启MySQL。

查看该属性设置为多大
show global variables like '%max_connect_errors%';

当客户端连接服务端超时(超过connect_timeout), 服务端就会给这个客户端记录一次error,
当出错的次数达到max_connect_errors的时候,这个客户端就会被锁定。
所以根据业务来尽量把这个值设置大一点,mysql默认值为10,这里设置为1000.
并非越大越好,越大被攻击时安全性越低。
set global max_connect_errors=1000;
【方法二】
刷新记录报错host的文件
mysqladmin  -uroot -p  -h192.168.1.1 flush-hosts
或
mysql>flush hosts;
————————————————
https://blog.csdn.net/ningjiebing/article/details/102408136

 



这篇关于ERROR "Host is blocked because of many connection errors; unblock with 'mysqladmin flus的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程