MySQL/MariaDB -- Host blocked because many connection errors -- Flush Hosts -- Automate


#1

1. Introduction

This article explains how to use Core-Admin to solve connection errors that are cached by the MySQL/MariaDB server caused by errors by connection client applications like:

Host '35.x.x.206' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"

2. Quick solution with Core-Admin

So far, there is no way to disable this feature from MySQL/MariaDB server that blocks any connecting client that accumulate connection errors. Solutions available are:

  1. To use “Flush host” option provided by #MySQLManager like this:

    image

    …then select which MySQL/MariaDB server you want to apply FLUSH HOSTS command. Optionally you can select apply them all. It is safe to run this command on a production environment:

    image

  2. At the same time, if the situation repeats you have several options: to increase max number of errors that must be reached to start block or automate FLUSH HOSTS command.

3. Increase max connect errors to make less frequent Host blocked

The following steps assume you cannot modify client side MySQL/MariaDB application to fix errors that are causing this blockings. The best way to go is to always fix errors. In case it is not possible, use the following.

Here are the steps to configure your MySQL/MariaDB server to increase max connect errors (max_connect_errors) so Host blocked by these errors are less frequent:

  1. Go you the MySQL/MariaDB server you want to configure and inside MySQL server settings, increase max connect errors. This change will restart the MySQL/MariaDb server.

4. Automate FLUSH HOSTS to execute it at regular intervals

The following steps assume you cannot modify client side MySQL/MariaDB application to fix errors that are causing this blockings. The best way to go is to always fix errors. In case it is not possible, use the following.

Here are the steps to configure Core-Admin to send “FLUSH HOSTS” command at a configured interval so your MySQL/MariaDB server resets counting that are causing these blockings. Here is how:

  1. Go you the MySQL/MariaDB server you want to configure and inside MySQL server settings, and configure automate flush hosts with needed value . This change will NOT restart the MySQL/MariaDb server.