文档章节

host blocked because of many connection errors

威哥
 威哥
发布于 2015/11/20 14:07
字数 525
阅读 450
收藏 0

钉钉、微博极速扩容黑科技,点击观看阿里云弹性计算年度发布会!>>>

unblock with 'mysqladmin flush-hosts'
思路 

  1. 查看连接数

    Max_used_connections / max_connections * 100% ≈ 85%

    一般的服务 最大设置1000 以下就差不多了

  2. 查看最大错误连接设置

  3. 是否是锁表

  • 是否并发访问

    最后 去查看相关资料 也是这样操作的,详细请查看



  • If you get a MySQL error like:

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

  • This most likely means your PHP / Java whatever programming language application connecting to MySQL is failing to authenticate with the application created (existing) or that the application is trying too many connections to MySQL in a rate where MySQL server can't serve all the requests.

  • Some common errors for Too many Connection errors are:
     

  • Networking Problem

  • Server itself could be down

  • Authentication Problems

  • Maximum Connection Errors allowed.

  • The value of the max_connection_errors system variable determines how many successive interrupted connection requests are permitted to myqsl server.
     

  • Well anyways if you get the:

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

  • You can consider this a sure sign application connections to MySQLis logging a lot of error connections, for some reason.
    This error could also appear on very busy websites where high amount of separete connections are used – I've seen the error occur on PHP websites whether mysql_pconnect(); is selected in favour of the prooved working mysql_connect();

  • The first thing to do before changing / increasing default set of max connection errors is to check how many max connection errors are set within MySQL?

  • For that connect with MySQL CLI and issue:
     

  • mysql> SHOW VARIABLES LIKE '%error%';


  • +——————–+————————————————————-+
    | Variable_name      | Value                                                           |
    +——————–+————————————————————-+
    | error_count        | 0                                                                     |
    | log_error          | /var/log/mysql//mysqld.log                                |
    | max_connect_errors | 10000                                                      |
    | max_error_count    | 64                                                               |
    | slave_skip_errors  | OFF                                                             |
    +——————–+————————————————————-+


  • A very useful mysql cli command in debugging max connection errors reached problem is

  • mysql> SHOW PROCESSLIST;

  •  

  • To solve the error, try to tune in /etc/my.cnf, /etc/mysql/my.cnf or wherever my.cnf is located:

  • [mysqld]
    max_connect_errors
    variable

  • and

  • wait_timeout var. Some reasonable variable size would be:

  • max_connect_errors = 100000
    wait_timeout = 60

  • If such (anyways) high values is still not high enough you can raise mysql config connection timeout

  •  

  • to

  • max_connect_errors = 100000000

  • Also if you want to try raise max_connect_errors var without making it permanenty (i.e. remember var setting after MySQL service restart), set it from MySQL cli with:

  • SET GLOBAL max_connect_errors


  • If you want to keep the set default max_connection_errors and fix it temporary, you can try to follow the error

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

  • suggestion and issue in root console:

  • mysqladmin flush-hosts

  • Same could also be done from MySQL Cli with cmd:
     

  • FLUSH HOSTS;

  • - See more at: http://pc-freak.net/blog/host-blocked-connection-errors-unblock-mysqladmin-flushhosts/#sthash.5Gx5ukgE.dpuf


原文地址 http://pc-freak.net/blog/host-blocked-connection-errors-unblock-mysqladmin-flushhosts/

威哥
粉丝 18
博文 21
码字总数 14506
作品 0
大兴
程序员
私信 提问
加载中
请先登录后再评论。
MairaDB中,MySql Host is blocked because of many connection errors; unblock with 'mysqladmin fl...

MairaDB中,MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法 环境:linux,10.0.38-MariaDB, 错误:Host is blocked because o......

osc_c7lpn2ge
2019/07/11
2
0
MySQL参数max_connect_errors分析

一、问题引入 最近一台mysql服务器报错:ERROR 1129 (00000): Host 'xxx' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'。 本质原因: 因为同一个I......

osc_iazh5wbp
2019/12/01
7
0
MySQL参数max_connect_errors分析释疑

最近一MySQL服务器,由于一些特殊因素遇到“ERROR 1129 (00000): Host 'xxx' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'”,在问题解决后,在详......

紫暘
04/21
2
0
Mysql flush-hosts

MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法 环境:linux,mysql5.5.21 错误:Host is blocked because of many connectio......

茅茹
2016/05/10
6
0
mysql 无法连接问题many connection

MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法 环境:linux,mysql5.5.21 错误:Host is blocked because of many connectio......

younchen
2014/01/14
637
1

没有更多内容

加载失败,请刷新页面

加载更多

微信小程序|navigator组件-实现页面跳转

欢迎点击「算法与编程之美」↑关注我们! 本文首发于微信公众号:"算法与编程之美",欢迎关注,及时了解更多此系列文章。 问题描述 现在大家所用的各种微信小程序都是看似结构简单、内容精炼...

算法与编程之美
03/31
0
0
【leetcode刷题】20T26-最后一个单词的长度

木又同学2020年第26篇解题报告 leetcode第58题:最后一个单词的长度 https://leetcode-cn.com/problems/length-of-last-word/ 【题目】 给定一个仅包含大小写字母和空格 ' ' 的字符串 s,返回...

唐建权
03/01
0
0
我的电脑不联网,很安全。黑客:你还有风扇呢!

点击蓝色“ Python空间 ”关注我丫 加个“星标”,每天一起快乐的学习 转自机器之心 从 1988 年第一个网络蠕虫病毒诞生以来,「互联网危机四伏」的观念就已经深入人心。如果只是这样,不给电...

Rocky0429
05/10
0
0
[codeforces 1372D] Omkar and Circle 圆上区间动归

Codeforces Round #655 (Div. 2) 参与排名人数15842 天天熬夜打比赛,身体吃不消,作了一个充满幸福感的决定,赛后第二天再刷 [codeforces 1372D] Omkar and Circle 圆上区间动归 总目录详见htt...

osc_9mt0ncuk
5分钟前
0
0
不断进化的分支和需求管理

昨天有朋友在公众号私信问我几个关于代码分支管理的问题,这几个问题是我去年写的《在团队中使用GitLab中的Merge Request工作模式》一文结尾时抛出的几个问题: 如果系统上线后有紧急Bug需要...

冯威
2019/06/07
0
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部