环境:linux,mysql5.5.31错误:Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

原因:

  同一个ip在短时间内产生太多(超过mysql数据库max_connection_errors的最大值)中断的数据库连接而导致的阻塞;

解决方法:

1、提高允许的max_connection_errors数量(治标不治本):

  ① 进入Mysql数据库查看max_connection_errors: show variables like '%max_connect_errors%';

    ② 修改max_connection_errors的数量为1000: set global max_connect_errors = 1000;

  ③ 查看是否修改成功:show variables like '%max_connect_errors%';

2、使用mysqladmin flush-hosts 命令清理一下hosts文件(不知道mysqladmin在哪个目录下可以使用命令查找:whereis mysqladmin);

  ① 在查找到的目录下使用命令修改:/usr/bin/mysqladmin flush-hosts -h192.168.1.1 -P3308 -uroot -prootpwd;

  备注:

    其中端口号,用户名,密码都可以根据需要来添加和修改;

    配置有master/slave主从数据库的要把主库和从库都修改一遍的(我就吃了这个亏明明很容易的几条命令结果折腾了大半天);

    第二步也可以在数据库中进行,命令如下:flush hosts;

Mysql连接错误:Mysql Host is blocked because of many connection errors的更多相关文章

  1. MySql Host is blocked because of many connection errors;

    错误:Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 原因: 同一个i ...

  2. MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法

    环境:linux,mysql5.5.21 错误:Host is blocked because of many connection errors; unblock with 'mysqladmin ...

  3. 黄聪:MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法(转)

    转自:http://www.cnblogs.com/susuyu/archive/2013/05/28/3104249.html 环境:linux,mysql5.5.21 错误:Host is blo ...

  4. MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法 -摘自网络

    错误:Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 原因: 同一个i ...

  5. (转!)MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法

    不要贪快,以你的聪明,只要有耐心,什么事不成,你真的争口气,羞羞这势利的世界也好! --久节奏,慢读书 转自:https://www.cnblogs.com/susuyu/archive/2013/0 ...

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

    环境:linux,mysql5.5.21 错误:Host is blocked because of many connection errors; unblock with 'mysqladmin ...

  7. 【错误】:MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

    错误:MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决 ...

  8. MySQL 出现 Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

    MySQL 出现 Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 一大 ...

  9. 【mysql报错】MySQL host is blocked because of many connection errors; 解决方法

    MySQL host is blocked because of many connection errors; 报错 环境 操作系统:Linux 数据库:mysql5.7.27 错误提示 jHost ...

随机推荐

  1. Lucene 7.2.1 自定义Analyzer和TokenFilter

    1.自定义Analyzer: @Test  public void t01() throws Exception {   ArrayList<String> strings = new A ...

  2. thinkphp设置默认访问的模块

    在index.php中加入(可以省略Home,直接写控制器和方法访问) define('BIND_MODULE','Home'); 在config.php里边加入 'MODULE_ALLOW_LIST ...

  3. openssl x509(签署和自签署)

    openssl系列文章:http://www.cnblogs.com/f-ck-need-u/p/7048359.html 主要用于输出证书信息,也能够签署证书请求文件.自签署.转换证书格式等. op ...

  4. .net core Identity集成IdentityServer4 (1)基本操作

    一. 新建asp.net core identity项目 新建项目->asp.net core web应用程序-> web应用程序(模型视图控制器)&更改身份验证为个人. 新建一个 ...

  5. asp.net mvc 模型验证组件——FluentValidation

    asp.net mvc 模型验证组件——FluentValidation 示例 using FluentValidation; public class CustomerValidator: Abst ...

  6. WPF Application 类介绍以及怎样修改启动方式

    因为想要修改wpf的启动方式,所以研究了下Application类,现把一些有用的属性与大家分享下: 属性: Current                  获取当前 AppDomain的 Appl ...

  7. razor视图使用三元表达式

    根据条件是否满足给input标签添加属性. <input type="radio" value="1" name="PortType" ...

  8. 数据机构-折半查找法(二分查找法)-Python实现

    Python实现二分查找法(基于顺序表) class List: elem=[] #存储顺序表元素 last=-1 #设置初始为-1 SeqList = List() #创建一个顺序表 print(& ...

  9. 写出java8实现对List<User>中的username字段过滤出不等于张三的数据

    写出java8实现对List<User>中的username字段过滤出不等于张三的数据... 对...这个是一道面试题.当时没有看过java8的新特性...所以有点懵. 看完之后感觉 真. ...

  10. Maven + SSM + Kaptcha 实现用户登录时验证码的获取(问题:302 Found)

    pom.xml(对Kaptcha.jar的引用) <!-- 验证码 jar kaptcha--> <dependency> <groupId>com.github. ...