`

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

 
阅读更多
错误: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 -h192.168.1.1 -P3308 -uroot -prootpwd;

  备注:

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

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

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


http://www.cnblogs.com/joeylee/p/3545467.html
http://www.cnblogs.com/susuyu/archive/2013/05/28/3104249.html

mysql数据库执行mysqladmin flush-hosts方法
当连接错误次数过多时,MySQL会禁止客户机连接,这个时候有两个办法解决:
1.使用mysqladmin flush-hosts命令清除缓存,命令执行方法如下:
命令行或终端:mysqladmin  -u  root  -p  flush-hosts
接着输入root账号密码即可

2.修改mysql配置文件,在[mysqld]下面添加 max_connect_errors=1000,然后重启mysql
分享到:
评论

相关推荐

    Java常见异常

    5. **ERROR 1129 (00000): Host ‘XXXXXX’ is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’** MySQL服务器将主机封锁,因为存在多次连接错误。使用`mysqladmin flush-...

    MySQL-Flush命令用法.docx#资源达人分享计划#

    使用 HOSTS 选项可以清空主机名缓存,这个选项通常用于清空主机名缓存以便解决 Host 'host_name' is blocked 错误。 3. LOGS:关闭并重新加载二进制日志文件。 使用 LOGS 选项可以关闭并重新加载二进制日志文件,...

    解决mysql出现大量TIME_WAIT

    如果MySQL出现“Host 'IP' is blocked because of many connection errors”的错误提示,表明由于过多的连接错误,该IP地址已被MySQL服务器封锁。此时,可以通过执行`mysqladmin flush-hosts -h IP -u root -p`命令...

    MySQL常见问题集锦详解-完整版.pdf

    解锁方法是运行`mysqladmin flush-hosts`。可以通过调整`max_connect_errors`变量来设置封锁前允许的最大错误次数。 5. **Too many connections**: 当达到`max_connections`限制时,无法建立更多连接。若需要增加...

    BURNINTEST--硬件检测工具

    Use a version of BurnInTest prior to 5.2 for compatibility with W98 and ME. Windows 95 and Windows NT ========================= Windows 95 and NT are not supported in BurnInTest version 4.0 and above...

    微软内部资料-SQL性能优化3

    To make use of either more or less strict isolation levels in applications, locking can be customized for an entire session by setting the isolation level of the session with the SET TRANSACTION ...

    iframe跨域问题

    iframe跨域问题:Uncaught DOMException Blocked a frame with origin解决方法

    一个小游戏

    Gameloft的笔试 Rules of Game: ---------... If one sphere is blocked because there is something underneath, the other one will continue falling (with no player control over it) until it reaches something.

    node-blocked, 检查事件循环是否已经被阻止.zip

    node-blocked, 检查事件循环是否已经被阻止 块检查 node 事件循环是否被阻止。如果运行 node.js ,你可以使用非常类似的阻止阻塞函数,从而使用非常类似的阻止阻塞函数。安装$ npm install blocked描述blocked() ...

    word自动转化为chm

    However, what bothers you most is not using how many kinds of tools, the Word file, the CHM file and the online documents are all need to be modified, this is the real matter. Once the changing work ...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - ADD: In TFlexPanel.DefaultLinkPoint property added Size field that lets define visual size of the connection points of the flex-connectors. Initialized with DefaultLinkPointSize constant in the ...

    apache-maven-3.5.4

    Since Maven 3.8.1 http repositories are blocked. Possible solutions: - Check that Maven settings.xml does not contain http repositories - Check that Maven pom files do not contain ...

    Sakemail

    Because some people need to use IP addresses instead of Host names, I‘ve added a new property IPAddress to SakPOP and SakSMTP. If both are filled, then the Host name will be used, thanks to Roger F. ...

    Your page is blocked due to a security的解决方案

    关于Your page is blocked due to a security的解决方案

    erase-blocked-user-in-discord-crx插件

    【erase-blocked-user-in-discord-crx插件】是一款针对Discord聊天平台的浏览器扩展程序,主要用于帮助用户更便捷地管理被屏蔽用户的聊天信息。这款插件特别适用于那些希望保持聊天环境整洁,避免看到被阻止用户消息...

    VclZip pro v3.10.1

    Added a final call to OnTotalPercentDone with 100% because this didn't always happen. Attributes were not getting set correctly for directory-only entries. Fixed a problem that was not allowing ...

    Accelerated .NET Memory Dump Analysis

    The full transcript of Software Diagnostics Services training with 13 step-by-step exercises, notes, source code of specially created modeling applications and selected Q&A. Covers 22 .NET memory dump...

    SQL Server并发性:锁定,阻止和行版本控制SQL Server Concurrency: Locking, Blocking and Row Versioning

    一本面向想要了解SQL Server并发性以及如何解决过多的阻塞或死锁问题的DBA和开发人员的书。

    EurekaLog_7.5.0.0_Enterprise

    9)....Added: EMemLeaks._ReserveOutOfMemory to control reserve size of out of memory errors (default is 50 Mb) 10)..Added: "MinLeaksLimitObjs" option (EMemLeaks unit) 11)..Added: Fatal memory problem ...

Global site tag (gtag.js) - Google Analytics