Could not create connection to database server. Attempted reconnect 3 times. Giving up.
报出这个错误,可能原因:
1、检查MySQL数据库服务是否正常(包含检查服务名和密码),如果不正常,修复至正常为止;
2、maven工程中导入的mysql的jar版本和你的MySQL版本不相符,必须相一致才行!比如,你安装的MySQL是8.x,必须使用高版本对应的mysql-connector-java-8.x.x,同时application.yml里的 driver-class-name: com.mysql.cj.jdbc.Driver
3、连接数据库相关的属性和值不正确或缺失,按照报错提示修改或更新即可。
我在创建spring-boot项目,启动也报同样的错误,但是MySQL服务是正常的,后面检查发现,我的MySQL安装的是版本8.0的,而工程对应的mysql连接jar包是5.1.43版本,将低版本替换为mysql-connector-java-8.0.16.jar,同步更新对应的连接属性,启动成功。
1、将所有的driver-class-name值都从com.mysql.jdbc.Driver修改为com.mysql.cj.jdbc.Driver
2、在url的参数后面新增时区参数:&serverTimezone=UTC
3、修改url连接参数中的值更新为:zeroDateTimeBehavior=CONVERT_TO_NULL.
Could not create connection to database server. Attempted reconnect 3 times. Giving up.的更多相关文章
- 通过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 ...
- Could not create connection to database server. Attempted reconnect 3 times. Giving up.错误
项目是基于springboot框架,昨天从git上pull代码之后也没有具体看更改的地方,结果运行的时候就报错了. java.sql.SQLNonTransientConnectionExceptio ...
- [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. 点击这里 ...
- [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 ...
- 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 ...
- 解决idea中mysql连接失败Could not create connection to database server. Attempted reconnect 3 times. Giving up.
原因是少一个参数,设置时区的. 解决方法: 加一个参数: serverTimezone=UTC jdbc:mysql://localhost:3306/SshProject?useUnicode=t ...
- 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 后面街上一句 因为笔 ...
- pycharm2019连接mysql错误:08801 ------Connection to django1@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
- 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 成功后为:
随机推荐
- 【解决】挂载NFS服务时,不同共享客户端间的数据不同步
问题现象 当您用台 ECS 挂载同一个 NFS 文件系统,在 ECS-A 上 append 写文件,在 ECS-B 用 tail -f 观察文件内容的变化.在 ECS-A 写完之后,在 ECS-B 看 ...
- 无法打开jetbrains官网
找到下面hosts文件,用记事本打开,删除关于jetbrain的文字 需要管理员权限才能操作这个文档: 先后输入cmd和 notepad hosts 删除掉关于jetbrains的模块,再次访问htt ...
- Beta冲刺第3次
一.团队成员的学号姓名列表 学号 姓名 201731103226 翟仕佶 201731062517 曾中杰 201731062424 杨模 201731062632 邓高虎 201731062624 ...
- 项目Beta冲刺(团队)——05.29(7/7)
项目Beta冲刺(团队)--05.29(7/7) 格式描述 课程名称:软件工程1916|W(福州大学) 作业要求:项目Beta冲刺(团队) 团队名称:为了交项目干杯 作业目标:记录Beta敏捷冲刺第7 ...
- python应用-打印各种形状图
row = int(input('请输入行数: ')) for row in range(1,row): for col in range (1,row+1): print( (col),end='' ...
- wordpress不同分类调用不同的模板
今天网友问ytkah:wordpress不同分类如何调用不同的模板.我们知道in_category() 函数可以通过分类别名或ID判断当前文章所属的分类,而且可以直接在循环(Loop)内部和外部使用. ...
- secureCRT无操作自动登出时间修改(亲测可用)
转自:http://blog.sina.com.cn/s/blog_6bcf42010102vlt9.html secureCRT连接机器经常会因为一段时间无操作就退出了,提示timed out wa ...
- Reactive Extensions (Rx) 入门(2) —— 安装 Reactive Extensions
译文:https://blog.csdn.net/fangxing80/article/details/7581937 原文:http://www.atmarkit.co.jp/fdotnet/int ...
- 8-网页,网站,微信公众号基础入门(使用Python程序实现微信token验证)
https://www.cnblogs.com/yangfengwu/p/11062034.html 设置一下IP白名单: 填写自己的服务器的IP地址 是不是不可以哈,有多少人都会入这个坑.... ...
- linux grep 查询多行的方法
linux grep 查询多行的方法 经常查询 git log 中使用的方法, 如下 git log |grep "xxxx" 如果想查询多行的话, 就有些尴尬, 如果想查询多行的 ...