2

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.

  • are you getting same result when you try with: "mysqladmin flush-hosts -u [username] -p" directly from command line ? – Jay Jan 26 '19 at 19:22
  • @Jay I haven't tried your method, but I assume it'd be exactly the same, as I have ~/.my.cnf (which contains username and password). – alexus Jan 26 '19 at 20:08
  • You probably need to connect as user "root" or some other SUPER user. – Rick James Jan 27 '19 at 3:03
  • Maybe the host gets blocked again right after you flush it? – eckes Jan 27 '19 at 10:15
  • @RickJames as I mentioned, I already use that as ~/.my.cnf contains root credentials, which has SUPER privilege. – alexus Jan 28 '19 at 15:04
3

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).

|improve this answer|||||

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.