当前位置:网站首页>Mysql高低版本切换需要修改的配置5-8(此处以aicode为例)
Mysql高低版本切换需要修改的配置5-8(此处以aicode为例)
2022-07-07 04:15:00 【你若不离不弃,我必生死相依】
初次启动数据库版本高低冲突导致的报错:
WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
我本地环境是8.0的MYsql 数据库故配置修改为 8.0
<mysql-connector-java.version>8.0.21</mysql-connector-java.version>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java.version}</version>
</dependency>
或者
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.21</version>
</dependency>
修改完之后
再次启动报错:
Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
把com.mysql.jdbc.Driver修改com.mysql.cj.jdbc.Driver
我们做如下修改
加入这个
driver-class-name: com.mysql.cj.jdbc.Driver

Could not create connection to database server. Attempted reconnect 3 times. Giving up.
1、将所有的driver-class-name值都从com.mysql.jdbc.Driver修改为com.mysql.cj.jdbc.Driver(上面说过了)
2、在url的参数后面新增时区参数:&serverTimezone=UTC
3、修改url连接参数中的值更新为:zeroDateTimeBehavior=CONVERT_TO_NULL
spring:
profiles: dev
datasource:
#url: jdbc:mysql://localhost:3306/easycode?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull
url: jdbc:mysql://localhost:3306/easycode?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=UTC
username: root
password: root
filters: log4j,wall,mergeStat
driver-class-name: com.mysql.cj.jdbc.Driver
注释了的是以前的;新的是修改后的;
希望可以帮助到大家;
边栏推荐
- Outsourcing for four years, abandoned
- Mutual conversion between InputStream, int, shot, long and byte arrays
- 按键精灵采集学习-矿药采集及跑图
- 三、高质量编程与性能调优实战 青训营笔记
- Blue Bridge Cup Birthday candles (violence)
- UWB learning 1
- 【leetcode】1020. Number of enclaves
- 95后CV工程师晒出工资单,狠补了这个,真香...
- 深度学习花书+机器学习西瓜书电子版我找到了
- Dynamics CRM server deployment - restore database prompt: the database is in use
猜你喜欢

2、 Concurrent and test notes youth training camp notes

1141_ SiCp learning notes_ Functions abstracted as black boxes

How can a 35 year old programmer build a technological moat?

My ideal software tester development status

2022-07-06: will the following go language codes be panic? A: Meeting; B: No. package main import “C“ func main() { var ch chan struct

Jenkins远程构建项目超时的问题

IPv4 exercises

通信设备商,到底有哪些岗位?

MobaXterm

About some details of final, I have something to say - learn about final CSDN creation clock out from the memory model
随机推荐
Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.9 introduction to network interface (IX) extending the request3 met
Example of Pushlet using handle of Pushlet
测试周期被压缩?教你9个方法去应对
Docker compose start redis cluster
How can a 35 year old programmer build a technological moat?
Summary of customer value model (RFM) technology for data analysis
外包干了四年,废了...
2、 Concurrent and test notes youth training camp notes
JS plot flot application - simple curve
身边35岁程序员如何建立起技术护城河?
My ideal software tester development status
Detailed explanation of neo4j installation process
I failed in the postgraduate entrance examination and couldn't get into the big factory. I feel like it's over
leetcode:105. Constructing binary trees from preorder and inorder traversal sequences
Tencent's one-day life
What is the difference between TCP and UDP?
BGP experiment (1)
【Unity】物体做圆周运动的几个思路
为什么要了解现货黄金走势?
4、 High performance go language release optimization and landing practice youth training camp notes