MySQL Host is blocked because of many connection errors 解决方法

时间:2022-09-10 12:04:52

应用日志提示错误:
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. mysql_建立索引的优缺点 #转自Starzm#

    建立索引的优缺点: 为什么要创建索引呢? 这是因为,创建索引可以大大提高系统的性能.         第一.通过创建唯一性索引,可以保证数据库表中每一行数据的唯一性.         第二.可以大大加 ...

  2. 15 款最好的 C/C++ 编译器和集成开发环境

    我们有很多编程语言来进行 web 开发,比如 Java,.Net,PHP,Ruby,Perl,Python 等等.今天我们主要讨论的是两大古老而又流行的语言: C 和 C++ ,它们有着许多卓越的特性 ...

  3. 开始记录blog

    将自己的总结.新的记录下来,形成习惯,为以后的温故知新

  4. dnf的动画脚本研究

    . 1.0x00    : 帧数           int16 2.0x02    : 总为1(?) int16 3.0x04  : 资源文件名长度 int32 4.长度+1 :   0,1(未知用 ...

  5. vb.net中常用键值

    可在代码中的任何地方用下列常数代替实际值: 常数 值 描述 vbKeyLButton 0x1 鼠标左键 vbKeyRButton 0x2 鼠标右键 vbKeyCancel 0x3 CANCEL 键 v ...

  6. Linux文件误删除恢复操作

    作为一个多用户.多任务的操作系统,Linux下的文件一旦被删除,是难以恢复的.尽管删除命令只是在文件节点中作删除标记,并不真正清除文件内容,但是 其他用户和一些有写盘动作的进程会很快覆盖这些数据.不过 ...

  7. epoll使用详解(精髓)

    epoll使用详解(精髓) epoll - I/O event notification facility 在linux的网络编程中,很长的时间都在使用select来做事件触发.在linux新的内核中 ...

  8. 使用Git与Github创建自己的远程仓库

    原因 早就想创建一个自己的远程仓库,方便发布到Nuget上,自己用也好,项目组用也好,都方便. 今天抽了个时间建了个仓库,随便记下溜方便后来的人. 流程 1,创建自己的GitHub仓库 首先需要到 G ...

  9. EChart 猜猜乐

    http://m.bkbtcaicaile.hyl.life/index.html#/

  10. ELK6.0部署:Elasticsearch+Logstash+Kibana搭建分布式日志平台

    一.前言 1.ELK简介 ELK是Elasticsearch+Logstash+Kibana的简称 ElasticSearch是一个基于Lucene的分布式全文搜索引擎,提供 RESTful API进 ...