Host 'host_name' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'

dba.stackexchange https://dba.stackexchange.com/questions/228158

  •  21-01-2021
  •  | 
  •  

Question

I'm getting following message:

Host 'host_name' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'

I've tried to follow MySQL :: MySQL 8.0 Reference Manual :: B.6.2.5 Host 'host_name' is blocked like so, yet without success(

# mysql --version
mysql  Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1
# mysqladmin flush-hosts
# echo $?
0
# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2221
Server version: 5.1.73-log Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> FLUSH HOSTS;
Query OK, 0 rows affected (0.00 sec)

mysql> Bye
# 

I even tried to restart mysqld, still getting same message(

Please advise.

Was it helpful?

Solution

I was able to resolve my issue with following:

# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 216305
Server version: 5.1.73-log Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SET GLOBAL max_connect_errors=10000;
Query OK, 0 rows affected (0.00 sec)

mysql> Bye
# 

I'm not entirely sure, if that actually what addressed my issue, however after above SQL statement, my app started to work (without being blocked anymore).

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top