mysql 报 'Host ‘XXXXXX’ is blocked because of many connection errors'

1. 问题:服务启动时,日志报错,导致启动失败:

Caused by: com.mysql.cj.exceptions.CJException: null,  message from server: "Host 'ip' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"

 2. 解决:

(1)如果mysql 在当前机器,使用 mysql -u 用户名 -p  输入密码登录mysql

 (2)  如果mysql 不在当前机器,使用 mysql -h 主机地址 -u 用户名 -p 用户密码

 (3)  执行:flush hosts;

ok

原文地址:https://www.cnblogs.com/wtx106/p/15234421.html