错误信息

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. python常用的搜索字符内容函数详解:re.findall/findfiter

    区别findall返回listfinditer返回一个MatchObject类型的iterator详细举例介绍1.findall在字符串中找到正则表达式所匹配的所有子串,并返回一个列表,如果没有找到匹 ...

  2. renren-fast-vue@1.2.2 项目编译报错: build `gulp`

    问题呈现: PS D:\Code\Java\ideaWorkspace\renren-fast-vue> npm run build > renren-fast-vue@1.2.2 bui ...

  3. SSL证书类型价格和购买

    SSL证书 SSL和HTTPS的工作机制就不多说了, 密钥交换加通道依然是非常靠谱的安全访问方式, 除非你的浏览器连证书和DNS都被劫持, 否则中间节点要解密/篡改HTTPS访问的可能性微乎其微. 现 ...

  4. Java判断一个字符串中是否包含数字

    知识点 本例考察以下Java知识点: 正则表达式 关于正则表达式: https://www.runoob.com/java/java-regular-expressions.html Characte ...

  5. Vue+SpringBoot+ElementUI实战学生管理系统-4.后端API编写

    1.章节介绍 前一篇介绍了项目的表结构设计,这一篇编写后端API,需要的朋友可以拿去自己定制.:) 2.获取源码 源码是捐赠方式获取,详细请QQ联系我 :)! 3.项目截图 登录页 列表操作 动态图 ...

  6. 如何用Apipost校验响应结果

    数据校验的意义 我们可以通过 json-schema 预先定义接口的数据返回格式,当接口完成后,我们可以通过匹配 实际响应结果 和 预先定义的接口格式 ,来发现接口问题.如下图: 数据校验的设置 我们 ...

  7. git tag 常用操作-创建、查看、推送、删除等

    创建tag 1.创建tag: git tag -a v0.0.1 或者 对某一提交的信息打tag标签,末尾是一个commit id git tag -a v0.0.1 cc16905 2.创建tag带 ...

  8. RK3568开发笔记(三):RK3568虚拟机基础环境搭建之更新源、安装网络工具、串口调试、网络连接、文件传输、安装vscode和samba共享服务

    前言   开始搭建RK3568的基础虚拟机,具备基本的通用功能,主要包含了串口工具minicom,远程登陆ssh,远程传输filezilla,代码编辑工具vscode.   虚拟机   文档对对虚拟机 ...

  9. socket及黏包现象及解决黏包---day28

    1.四次挥手(补充) 客户端向服务端发送一个请求消息,断开连接(代表客户端没有数据传输了) 服务端接收请求,发出响应 等到服务端所有数据收发完毕之后 服务端向客户端发送断开连接的请求 客户端接收请求后 ...

  10. Golang使用Gin-swagger搭建api文档

    前提是安装好了go环境与vscode环境 并配置过了gin 项目结构 1.先安装swaggo依赖包 //1 go get "github.com/swaggo/files" //2 ...