MySql Host is blocked because of many connection errors

1.错误情况

Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

2.原因

从异常信息可以得知就是出现了太多的链接错误。可能原因有,错误的请求、连接超时过多等等。

3.解决

3.1如何解决

https://dev.mysql.com/doc/refman/8.0/en/host-cache.html#host-cache-flushing

3.2 host_cache 内部有什么

https://dev.mysql.com/doc/refman/8.0/en/performance-schema-host-cache-table.html

4.可问题还没解决

通过flush hosts 清除了被锁的信息,可以正常地访问数据库了。但是同一台机器上的其他服务却可以进行访问数据,难道锁的不是整个ip吗?

mysql中的host

https://dev.mysql.com/doc/refman/8.0/en/performance-schema-hosts-table.html可以看到host 是

  • The host from which the client connected. This is NULL for an internal thread, or for a user session that failed to authenticate.

通过指令能够更加清楚明白。

mysqladmin proc stat
mysqladmin proc stat.png

host是指程序运行的ip+端口

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容