在运行seata示例时碰到这个问题,具体如何发生原因暂不清楚:
Host is blocked because of many connection errors; unblock with '
mysqladmin flush-hosts
'
网上搜索了一下找到了解决方法,也记录一下:
打开命令行,进入MySQL安装目录的bin文件夹下执行以下命令:
mysqladmin -u[username] -p flush-hosts
执行后输入用户密码,正常执行后可以解决问题。
相关概念:
mysqladmin
Client for Administering a MySQL Server
管理MySQL服务器的客户端工具
Host Cache
The MySQL server maintains a host cache in memory that contains information about clients: IP address, host name, and error information. The Performance Schema host_cache
table exposes the contents of the host cache so that it can be examined using SELECT
statements. This may help you diagnose the causes of connection problems.
MySQL服务器会在内存中维护一个关于客户端信息的主机缓存,包括客户端ip、客户主机名称以及错误信息,在Performance Schema的host_cache表中可以查看相关信息。
select * from performance_schema.host_cache
FLUSH Statement
FlUSH HOST 是FLUSH的功能之一,用于清空主机缓存和主机缓存表,并且解除对已阻塞主机的拦截
Empties the host cache and the Performance Schema host_cache
table that exposes the cache contents, and unblocks any blocked hosts.
网友评论