如何知道MySQL的“拒绝连接" [英] How to know about MySQL 'refused connections'
问题描述
我正在使用MONyog监视两个MySQL服务器.出现问题时,我会收到来自MONyog的警报电子邮件.我无法找到原因,这是一个错误.它说:
I am using MONyog to montitor my two mysql servers. I get alert emails from MONyog when something goes wrong. There is an error I could not find out why. It says:
连接历史记录:拒绝连接的百分比)-66.67%
Connection History: Percentage of refused connections) - 66.67%
该百分比并不重要,这仅与拒绝连接有关.我每半小时收到这封电子邮件.因此,这就像一个持续的情况.这肯定是我的错误,因为我只是设置了这些服务器,而其他任何人都不会干扰服务器.
the percentage is not important, this is just about having refused connections. I get this email every half an hour. So this is like a constant situation. This must be my mistake, because I just set up those servers and there is no chance somebody else could be interfering the servers.
MONyog建议我:
MONyog advices me:
- 尝试隔离使用错误密码或试图从未经授权的主机进行连接的用户/应用程序.
- 如果连接花费的时间超过connect_timeout秒,则客户端将无法连接.
- 将log_warnings系统变量的值设置为2.这将强制MySQL服务器记录有关该错误的更多信息.
我在my.cnf
中添加了log_warnings=2
,并启用了这样的日志记录:
I added log_warnings=2
to my.cnf
and I enabled logging like this:
[mysqld_safe]
.
.
log_warnings=2
log-error = /var/log/mysql/error.log
.
.
.
.
[mysqld_safe]
.
log-error=/var/log/mysqld.log
.
.
我在/var/log/mysql/error.log
上看不到任何警告
我可以在/var/log/mysqld.log
看到一些警告,但它们与其他警告有关.
I cannot see any warnings at /var/log/mysql/error.log
I can see some warnings at /var/log/mysqld.log
but they are about something else.
总而言之,我的问题是如何检测拒绝的连接?请让我知道是否需要更多信息.
In sum, my question is how can I detect refused connections? Please let me know if any more info is required.
谢谢.
推荐答案
已解决
Solved
log_warnings=2
应该是
log-warnings=2
这篇关于如何知道MySQL的“拒绝连接"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!