2

We are running Percona MySQL 5.6.30. We've had an issue where a PHP script on a different host was reporting an issue connecting to the database:

Database may be down : SQLSTATE[HY000] [1129] Host 'x.x.x.101' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"

We did the flush hosts, and it resolved the issue.

When we went back to check the Percona Audit Logs for the same time, we see a number of connections at that same time, from that same host ('x.x.x.101').

I'm trying to understand how a host could be blocked, and not blocked, at the same time. :) Any ideas?

0

That host was blocked because there have been too many connection errors. The maximum number of errors before a host is blocked is represented by the max_connection_errors variable. Before reaching that number of errors, the host was not blocked.

The FLUSH HOSTS commands (or mysqladmin flush-hosts) empties the host cache. After that, the host can connect again and the errors counter is reset.

  • Agreed. And we have increased the max_connection_errors value. The confusing part is that during this outage, when things were not supposed to be able to connect, we have audit logs that show things connecting. :) – Michael Dugas Aug 15 '16 at 15:28
  • 1
    Indeed it's confusing. Can you paste here an exact record(s) that shows that? Looking at it, I can try understand what happened. – Federico Razzoli Aug 17 '16 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.