How to fix mariadb-admin flush-hosts / mysqladmin flush-hosts Issues?

How to fix mariadb-admin flush-hosts / mysqladmin flush-hosts Issues?

Reasons:

  • Application cannot connect to MariaDB/MySQL

  • Error: Host is blocked because of many connection errors

  • mariadb-admin or mysqladmin fails due to authentication issues

  • Remote connections suddenly stop working

Root cause

The issue occurs when the number of connection errors from a host exceeds the server variable:
  1. max_connect_errors

Root cause

Step 1: Run the flush-hosts command in the Database server

For MariaDB:

  1. mariadb-admin -u root -p flush-hosts

For MySQL:

  1. mysqladmin -u root -p flush-hosts

                  New to ADSelfService Plus?