MySQL Host is blocked because of many connection errors 解决方法
应用日志提示错误:
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 解决方法的更多相关文章
- 【mysql报错】MySQL host is blocked because of many connection errors; 解决方法
MySQL host is blocked because of many connection errors; 报错 环境 操作系统:Linux 数据库:mysql5.7.27 错误提示 jHost ...
- 【错误】: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' 解决 ...
- 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 ...
- 黄聪: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 ...
- 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 ...
- MySql Host is blocked because of many connection errors;
错误:Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 原因: 同一个i ...
- 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 ...
- (转!)MySql Host is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' 解决方法
不要贪快,以你的聪明,只要有耐心,什么事不成,你真的争口气,羞羞这势利的世界也好! --久节奏,慢读书 转自:https://www.cnblogs.com/susuyu/archive/2013/0 ...
- 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 ...
随机推荐
- nginx proxy_pass 代理域名
一.描述 1.nginx配置转发的时候使用的是域名,即使用dns服务方便配置和负载.但是nginx默认会进行缓存,当域名对应的服务出问题的时候就会报错,只有默认的缓存时间到了才会再次进行解析,ngin ...
- MySQL中间件之ProxySQL(3):Admin管理接口
返回ProxySQL系列文章:http://www.cnblogs.com/f-ck-need-u/p/7586194.html 1.ProxySQL的Admin管理接口 当ProxySQL启动后,将 ...
- ZooKeeper系列(2):ZooKeeper命令行工具zkCli.sh
ZooKeeper系列文章:https://www.cnblogs.com/f-ck-need-u/p/7576137.html#zk 1.简介 ZooKeeper提供了一个非常简单的命令行客户端zk ...
- [转]如何在Angular4中引入jquery
本文转自:https://blog.csdn.net/home_zhang/article/details/77992734 1.anjq是我的项目名称: 在anjq目录下打开dos命令窗口,然后依次 ...
- JDBC示例程序
import java.io.IOException; import java.io.InputStream; import java.sql.Connection; import java.sql. ...
- Java Date类的使用总结
Date类表示特定的瞬间,精确到毫秒. 有2种方法可以创建Date对象(这里不考虑已过时的构造函数) 1.public Date()——分配 Date 对象并初始化此对象,以表示分配它的时间(精确到毫 ...
- spring_06装配bean_2
一.前言 1.自动装配尽量不要用,不如使用set明确 二. 通过构造函数注入值(Bean中可以没有get,set方法) <bean id="emp" class=" ...
- Codeforces Round #308 (Div. 2)
A. Vanya and Table Vanya has a table consisting of 100 rows, each row contains 100 cells. The rows ...
- C#两个时间相减
原文地址:http://www.jb51.net/article/60177.htm using System; using System.Collections.Generic; using Sys ...
- 洛谷P4213 Sum(杜教筛)
题目描述 给定一个正整数N(N\le2^{31}-1)N(N≤231−1) 求ans_1=\sum_{i=1}^n\phi(i),ans_2=\sum_{i=1}^n \mu(i)ans1=∑i=1 ...