MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

环境:Linux,mysql5.7
错误:Host is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’
原因:
  同一个ip在短时间内产生太多(超过mysql数据库max_connection_errors的最大值)中断的数据库连接而导致的阻塞;
解决方法:
1、使用mysqladmin flush-hosts 命令清理一下hosts文件(不知道mysqladmin在哪个目录下可以使用命令查找:whereis mysqladmin);
   在查找到的目录下使用命令修改:/usr/bin/mysqladmin flush-hosts -h192.168.100.100 -P3306 -uroot -p123456;
  备注:
    其中端口号,用户名,密码都可以根据需要来添加和修改;
    配置有master/slave主从数据库的要把主库和从库都修改一遍;
2、也可以在数据库中进行,输入命令:flush hosts;

猜你喜欢

转载自blog.csdn.net/qq_41610418/article/details/81541601