"Host 'xxx.xxx.xxx.xx' is blocked because of many connection errors; unblock with 'mysqladmin flush-

本文介绍了解决MySQL因多次连接错误导致主机被封锁的问题。提供了两种方法:一是使用mysqladmin命令执行flush-hosts;二是通过调整max_connect_errors参数来提高允许的最大连接错误数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误:java.sql.SQLException 
MESSAGE: null, message from server: "Host 'xxx.xxx.xxx.xx' is blocked because of many connection errors; unblock with 'mysqladmin flush-


1、进入mysql安装目录用mysqladmin命令执行 flush-hosts就搞定了,如在我的linux系统中

/usr/bin/mysqladmin -u root -p  flush-hosts


2、进入mysql:mysql -uroot -pmysql

提高允许的max_connection_errors数量(治标不治本):

  ① 进入Mysql数据库查看max_connect_errors: show variables like '%max_connect_errors%';
    ② 修改max_connec_errors的数量为1844674407370954751(能设多大,设多大): 
set global max_connect_errors = 1844674407370954751;
  ③ 查看是否修改成功:show variables like '%max_connect_errors%';
   show variables like "max_%"; 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值