应用日志提示错误:
create connection error, url: jdbc:mysql://10.45.236.235:3306/db_wang?useUnicode=true&characterEncoding=UTF-8, errorCode 1129, state HY000java.sql.SQLException: null, message from server: "Host '10.30.174.183' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'"

原因:

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

解决方法:

1、提高允许的max_connect_errors数量(这种方法不彻底,后期还可能导致异常出现):

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

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

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

2、使用mysqladmin flush-hosts 命令清理一下hosts文件

whereis mysqladmin查找mysqladmin的路径

  使用命令修改:

/usr/bin/mysqladmin flush-hosts -h192.168.1.121 -uroot -p

  备注:

   配置有master/slave主从数据库的要把主库和从库都修改一遍

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

MySQL Host is blocked because of many connection errors 解决方法的更多相关文章

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

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

  2. 【错误】: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' 解决 ...

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

  4. 黄聪: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 ...

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

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

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

  7. Mysql连接错误:Mysql Host is blocked because of many connection errors

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

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

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

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

    解决方法如下:  方法 1.在线修改提高允许的max_connection_errors数量: A. 登录Mysql数据库查看max_connection_errors: mysql>show ...

随机推荐

  1. leetcode — text-justification

    import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * * Source : https:/ ...

  2. 浅谈JavaScript之事件(上)

    一  简述JavaScript及其在浏览器中的地位 (一)  浏览器主要构成 虽然不同浏览器之间存在差异(如Google Chrome,Firefox,Safari和IE等),但单从浏览器构成来说,大 ...

  3. pxe+kickstart自动化批量安装系统详解-技术流ken

    前言 pxe+kickstart是一款可以实现自动化批量安装系统的服务,比较经典,下面将详细介绍此服务的安装和使用. 系统环境准备 系统版本:CentOS release 6.7 (Final) 内网 ...

  4. 基于SSM框架贺州学院校园二手交易平台设计与实现

    前言 这个是我当时的毕业论文,分享出来,给同学们参考. 绪论 随着中国新四大发明的诞生,网购成了千千万万网友们购物的新方式,新的购物方式促进商业的发展,但随着人们生活水平的提高,许多新购置的物品用了没 ...

  5. 数据可视化 seaborn绘图(2)

    统计关系可视化 最常用的关系可视化的函数是relplot seaborn.relplot(x=None, y=None, hue=None, size=None, style=None, data=N ...

  6. [转]Docker学习之四:使用docker安装mysql

    本文转自:https://blog.csdn.net/qq_19348391/article/details/82998391 Docker学习之一:注册Docker Hub账号 Docker学习之二 ...

  7. ASP.NET Core中使用Graylog记录日志

    以下基于.NET Core 2.1 定义GrayLog日志记录中间件: 中间件代码: public class GrayLogMiddleware { private readonly Request ...

  8. spring_01概念及案例

    1.什么是IOC? IOC概念:inverse of Controll,控制反转,所谓控制反转,就是把创建对象和维护对象关系的权利从程序中转移到spring的容器中(applicationContex ...

  9. 【Java每日一题】20170309

    20170308问题解析请点击今日问题下方的“[Java每日一题]20170309”查看(问题解析在公众号首发,公众号ID:weknow619) package Mar2017; public cla ...

  10. Dom对象的研究

    1.逻辑运算  ||  &&  ! 1||2   5&&4     !0 || 遇到第一个为true 的数字就终止并返回 && 遇到第一个为false ...