报出这个错误,可能原因:

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.的更多相关文章

  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. 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 后面街上一句 因为笔 ...

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

  9. 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. 云服务器 - 定时备份MariaDB/MySQL

    数据库数据备份尤为重要,而我们不会人工手动去备份,这样会很麻烦,我们都是通过服务器每日自定运行来做的,设置一个定时时间即可 首先我们看一下mysqldump这个文件的位置: 可以看到目录在 /usr/ ...

  2. LVSDR模型与持久连接

    LVS之DR模型以及持久连接 LVS的简单介绍 linux virtual server 简单来讲lvs是一段内核代码 类似于netfilter本身是一框架但不提供任何功能,但是在这框架上提供了能够根 ...

  3. P1850 换教室[dp+期望]

    流下了不会概率的眼泪,由于不会概率,转移少写了点东西... 这个dp很简单,就是一个普通的线性dp加点期望.(刚开始写这道题时信笔写下) \(dp[0/1][i][j]\)表示到第\(i\)个时间段时 ...

  4. graylog-docker安装

    Graylog安装(docker) 1.安装docker jdk1.8 2.下载docker镜像 docker pull mongo docker pull docker.elastic.co/ela ...

  5. 命令行的方式启动和关闭Mysql

    命令行的方式启动和关闭Mysql mysql -h 主机名 -P 端口号 -u 用户名 -p 密码 例如:mysql -h localhost -P 3306 -u root -p11111(p和密码 ...

  6. 【大数据】虚拟机-Ubuntu环境

    目标 1.宿主机器能相互访问 2.虚拟机能访问互联网 方法 1.VMWare--编辑---虚拟网络编辑器,选择宿主机上网网卡 2.虚拟机设置-网络适配器 3.宿主机网络设置查看 4.Ubuntu网络设 ...

  7. css实现input文本框的双边框美化

    <!DOCTYPE html><html><head><meta http-equiv="Content-Type" content=&q ...

  8. Codechef July Challenge 2019 Snake and Apple Tree

    费用流.把每个方格拆成 $T$ 个点,$t$ 时刻一个方格向周围四个方格的 $t + 1$ 的点连一条容量为 $1$ 费用为 $0$ 的边,向自身的 $t + 1$ 连一条容量为 $1$ 费用为该方格 ...

  9. [转载] miller rabin

    本文转载自https://www.cnblogs.com/zsq259/p/11602175.html Miller-Rabin 事先声明,因为菜鸡Hastin知识水平有限就是菜,因此语言可能不是特别 ...

  10. Linux/Windows 配置config 使用ssh连接

    Linux 产看本地是否有ssh 公私钥 1 cd ~/.ssh 2 ls -a 有的话继续(没有 ssh-keygen 生成) 将公钥内容复制到要连接的服务器用户下 方法一 ssh-copy-id ...