错误信息

Could not create connection to database server.Attempted reconnect 3 times .Giving up.

message from server: "Host ' X.X.X.X' is blocked because of many connection errors; unblock with ' mysqladmin flush-hosts

原因:

  同一个ip在短时间内产生太多(超过mysql数据库max_connect_errors的最大值)中断的数据库连接而导致的阻塞

解决方案:

查看max_connect_errors参数结果

show variables like 'max_connect_errors';

max_connect_errors是一个MySQL中与安全有关的计数器值,它负责阻止过多尝试失败的客户端以防止暴力破解密码的情况。max_connect_errors的值与性能并无太大关系,默认是10。意味着如果某一客户端尝试连接此MySQL服务器,但是失败(如密码错误等)10次 ,则MySQL会无条件强制阻止此客户端连接。
如果希望重置此计数器的值,则必须重启MySQL服务器或者执行mysql> flush hosts; 命令。当这一客户端成功连接一次MySQL服务器后,针对此客户端的max_connect_errors会清零。
  

解决方法1:修改max_connect_errors的值
(1)进入Mysql数据库查看max_connect_errors: 
> show variables like '%max_connect_errors%'; 
(2)修改max_connect_errors的值: 
> set global max_connect_errors = 100; 
(3)查看是否修改成功
> show variables like '%max_connect_errors%';

解决方法2:使用mysqladmin flush-hosts 命令清理一下hosts文件(不知道mysqladmin在哪个目录下可以使用命令查找:whereis  mysqladmin)
(1)在查找到的目录下使用命令修改:mysqladmin -u xxx -p flush-hosts
或者
> flush hosts;

解决方法3:重启mysqld
也可以在重启之前,在配置文件中将该参数调大。
# vi /etc/my.cnf
max_connect_errors = 100

Could not create connection to database server.Attempted reconnect 3 times .Giving up 解决的更多相关文章

  1. 通过dbcp链接池对数据库操作报 Cannot create PoolableConnectionFactory (Could not create connection to database server. Attempted reconnect 3 times. Giving up.)--解决方案

    org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for ...

  2. Could not create connection to database server. Attempted reconnect 3 times. Giving up.错误

    项目是基于springboot框架,昨天从git上pull代码之后也没有具体看更改的地方,结果运行的时候就报错了. java.sql.SQLNonTransientConnectionExceptio ...

  3. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up IDEA2019的database插件无法链接mysql的解决办法(08001错误)

    [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up. 点击这里 ...

  4. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.

    使用idea连接数据库的时候,报错为 [08001] Could not create connection to database server. Attempted reconnect 3 tim ...

  5. pycharm2019连接mysql错误08801 ------Connection to django1@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.

    Error:Connection to django1@localhost failed. [08001] Could not create connection to database server ...

  6. 解决idea中mysql连接失败Could not create connection to database server. Attempted reconnect 3 times. Giving up.

    原因是少一个参数,设置时区的.  解决方法: 加一个参数: serverTimezone=UTC jdbc:mysql://localhost:3306/SshProject?useUnicode=t ...

  7. Could not create connection to database server. Attempted reconnect 3 times. Giving up.

    报出这个错误,可能原因: 1.检查MySQL数据库服务是否正常(包含检查服务名和密码),如果不正常,修复至正常为止: 2.maven工程中导入的mysql的jar版本和你的MySQL版本不相符,必须相 ...

  8. pycharm连接mysql是出现Connection to orm02@127.0.0.1 failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.

    下面这个问题反正我是遇到了,也是难为我好几天,于是我决定发一个教程出来给大家看看!希望能帮助你们 原因: 可能是数据库的版本与本机装的驱动不匹配导致的, 解决方案一: 在 url 后面街上一句 因为笔 ...

  9. pycharm2019连接mysql错误:08801 ------Connection to django1@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.

  10. IntelliJ IDEA连接不上数据库 (Connection to testdb@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.)

    问题提示为: 原因:MySQL数据库版本为8.0以上,需要在URL加上时区,即加上?serverTimezone=GMT 成功后为:

随机推荐

  1. 【Unity3D】Renderer Feature简介

    1 3D 项目迁移到 URP 项目后出现的问题 ​ 3D 项目迁移至 URP 项目后,会出现很多渲染问题,如:材质显示异常.GL 渲染不显示.多 Pass 渲染异常.屏幕后处理异常等问题.下面将针对这 ...

  2. Oracle正则表达式实战

    原文链接:http://oracle-base.com/articles/misc/regular-expressions-support-in-oracle.php Introduction Exa ...

  3. Oracle11gr2新增APPEND_VALUES提示

    在11.2中,Oracle新增了APPEND_VALUES提示,使得INSERT INTO VALUES语句也可以使用直接路径插入. 例子很简单: SQL> SELECT * FROM V$VE ...

  4. day05---系统的重要文件(2)

    回顾 /etc/sysconfig/network-scripts/ifcfg-eth0 网卡配置文件 TYPE=Ethernet BOOTPROTO=none NAME=eth0 DEVICE=et ...

  5. 名校 AI 课程|斯坦福 CS25:Transformers United 专题讲座

    自 2017 年提出后,Transformer 名声大噪,不仅颠覆了自然语言处理(NLP)领域,而且在计算机视觉(CV).强化学习(RL).生成对抗网络(GANs).语音甚至是生物学等领域也大显锋芒, ...

  6. VIM初使化

    vim ~/.vimrc #设置编码 set encoding=utf-8 fileencodings=ucs-bom,utf-8,cp936 #显示行号 set number #一个tab为4个空格 ...

  7. 【Azure App Service for Container】记一次拉取镜像失败的特殊情况

    问题描述 使用Azure App Service For Container 拉取 应用镜像,发现拉取失败. 错误消息: "Image pull failed since Inspect i ...

  8. spark-sql 与hive 常用函数

    窗口函数与分析函数应用场景:(1)用于分区排序(2)动态Group By(3)Top N(4)累计计算(5)层次查询 窗口函数FIRST_VALUE:取分组内排序后,截止到当前行,第一个值LAST_V ...

  9. MapStruct的一些常规用法

    每天坚持写一篇原创文章. 使用过MapStruct之后,再也没用过BeanCopy来复制对象了.确实是非常好用的工具库. MapStruct是一个代码生成器,简化了不同的Java Bean之间映射的处 ...

  10. 10、zookeeper客户端curator

    curator介绍 https://blog.csdn.net/wo541075754/article/details/68067872 关于第三方客户端的小介绍 zkClient有对dubbo的一些 ...