当前位置:网站首页>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
注释了的是以前的;新的是修改后的;
希望可以帮助到大家;
边栏推荐
- ../ And/
- 【斯坦福计网CS144项目】Lab4: TCPConnection
- Cloud backup project
- [2022 CISCN]初赛 web题目复现
- 四、高性能 Go 语言发行版优化与落地实践 青训营笔记
- 1089: highest order of factorial
- L'externalisation a duré trois ans.
- 电商常规问题part1
- English translation is too difficult? I wrote two translation scripts with crawler in a rage
- What is the difference between TCP and UDP?
猜你喜欢
抽絲剝繭C語言(高階)指針的進階
Leetcode-226. Invert Binary Tree
Jenkins远程构建项目超时的问题
The annual salary of general test is 15W, and the annual salary of test and development is 30w+. What is the difference between the two?
After the interview, the interviewer roast in the circle of friends
Flutter riverpod is comprehensively and deeply analyzed. Why is it officially recommended?
【数学笔记】弧度
Robot technology innovation and practice old version outline
My ideal software tester development status
ASEMI整流桥RS210参数,RS210规格,RS210封装
随机推荐
JS get all date or time stamps between two time stamps
Music | cat and mouse -- classic not only plot
Rxjs - observable doesn't complete when an error occurs - rxjs - observable doesn't complete when an error occurs
抽丝剥茧C语言(高阶)数据的储存+练习
[ANSYS] learning experience of APDL finite element analysis
How to * * labelimg
Iterable、Collection、List 的常见方法签名以及含义
Leetcode-206. Reverse Linked List
Why is the row of SQL_ The ranking returned by number is 1
gslx680触摸屏驱动源码码分析(gslX680.c)
leetcode:105. 从前序与中序遍历序列构造二叉树
Redis data migration
My ideal software tester development status
Build personal website based on flask
misc ez_usb
Outsourcing for four years, abandoned
L'externalisation a duré trois ans.
Six methods of flattening arrays with JS
Convolutional neural network -- understanding of pooling
C language (high-level) data storage + Practice