环境:linux,mysql5.5.21

错误: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_connection_errors%';

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

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

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

  ① 在查找到的目录下使用命令修改:/usr/bin/mysqladmin flush-hosts -h 192.168.1.1 -P 3306 -u root -p rootpwd;

  备注:

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

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

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

Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'的更多相关文章

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

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

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

  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'

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

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

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

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

  8. mysql连接报错 Host ‘xxx’is blocked because of many connection errors;unblock with 'mysqladmin flush-hosts'

    程序无法连接MySQL,提示:  null, message from server: "Host '192.168.6.68' is blocked because of many con ...

  9. Could not create pool connection. The DBMS driver exception was: null, message from server: "Host '192.168.XX.XX' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

    早上打开浏览器准备登陆某个系统,发现Error 404--Not Found,有点奇怪,这个服务器应该没人用了才对,然后到weblogic后台去看日志,报如下错误: "Could not c ...

随机推荐

  1. 第五章:Reminders实验:第一部分[Learn Android Studio 汉化教程]

    Learn Android Studio 汉化教程 By now you are familiar with the basics of creating a new project, program ...

  2. 基于OpenCV读取摄像头进行人脸检测和人脸识别

    前段时间使用OpenCV的库函数实现了人脸检测和人脸识别,笔者的实验环境为VS2010+OpenCV2.4.4,opencv的环境配置网上有很多,不再赘述.检测的代码网上很多,记不清楚从哪儿copy的 ...

  3. github上的版本发布

    当前的版本号 发布版本 比如 git tag -a v1. 把这个版本发布到线上 git push --tags

  4. Linux下编译、安装并启动memcached

    首先使用yum安装gcc make.autoconf.libtool系列工具,这几个工具是编译所需要的,命令如下: yum install gcc make autoconf libtool 然后到l ...

  5. linux进程通信:消息队列

    消息队列可以实现两个没有关系的进程之间的通信. 创建了一个消息队列后,进程可以往里面放消息,也可以取消息.因为这个消息队列是有名字的,所以就算是两个没有关系的进程,也能通信. 而且人性化的一点是,可以 ...

  6. python的socket编程之udp编程

    在上篇文章中,仅仅讲述了如何进行了TCP编程,在本章中,将讲述使用udp进行编码,先看如下的代码,服务器端: root@python 513]# cat serverudp.py #!/usr/bin ...

  7. 转载:详解在visual studio中使用git版本系统(图文)

    很多人已经在使用git(或正在转移到git上),在github.com上,也看到不少国内同学的开源项目,非常不错.但相关教程似乎不多,所以趁着我自己的开源项目源码托管(https://github.c ...

  8. 「小程序JAVA实战」小程序注册与后端联调(35)

    转自:https://idig8.com/2018/09/01/xiaochengxujavashizhanxiaochengxuzhuceyuhouduanliandiao35/ 小程序的后端spr ...

  9. 控件的WndProc WindowProc

    SubClassWndProc This example shows how to use the WndProc method and the WindowProc property to subc ...

  10. Django中的DRF框架视图集使用

    1. 两个基类 1)APIView Django REST_framework 中所有视图的基类是APIView   父类是View 支持定义的属性: authentication_classes 列 ...