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?

1 Answer 1

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.

2
  • 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. :) Commented Aug 15, 2016 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. Commented Aug 17, 2016 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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