为什么我必须运行“冲洗主机”;我项目的每一天
我有一个在数字海洋上托管的LEMP堆栈项目。这显示
Host '167.71.227.200' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
我每天使用flush主机;
否则会给我同样的错误。 我该怎么做才能永久解决它。 我不喜欢数字主机和OPS。
I have a LEMP stack project that is hosted on digital ocean. that shows error
Host '167.71.227.200' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
every day i use FLUSH HOSTS;
otherwise it give me same error.
what should i do to solve it permanently.
i'm not to digital host and ops in general.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您忘记关闭应用程序中的数据库连接。
使用Conn.Close()确保每个查询后连接关闭
You are forgetting to close the database connection in your application.
Use conn.close() to ensure the connection is closed after each query
这可能是因为当客户端尝试连接到MySQL Server时,您经常出现错误。参见 https://dev.mysql.com /Doc/refman/8.0/en/host-cache.html#blocked-host
很容易增加
max_connect_errors
的值,但这只会稍微延迟问题。您的服务器看到很多错误的事实可能表明了您需要以另一种方式解决的根本原因。例如,这可能是由客户端和MySQL Server之间的不稳定网络引起的,因此连接尝试经常失败。您应该提高网络可靠性,否则将客户端转移到具有更稳定网络的主机。
这可能不是代码问题,而是基础架构问题。
This is likely because you have frequent errors when clients try to connect to your MySQL Server. See https://dev.mysql.com/doc/refman/8.0/en/host-cache.html#blocked-host
It's tempting to increase the value of
max_connect_errors
, but that will only delay the problem slightly. The fact that your server is seeing so many errors probably indicates a root cause that you need to address another way.For example, this could be caused by an unstable network between the client and the MySQL Server, so connection attempts frequently fail. You should improve the network reliability, or else move the client to a host that has a more stable network.
This is likely not a code problem, but an infrastructure problem.