当前位置:网站首页>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
注释了的是以前的;新的是修改后的;
希望可以帮助到大家;
边栏推荐
- L'étape avancée du pointeur de langage C (haut de gamme) pour l'enroulement des cocons
- 1141_ SiCp learning notes_ Functions abstracted as black boxes
- [Linux] process control and parent-child processes
- 在线直播系统源码,使用ValueAnimator实现view放大缩小动画效果
- 抽丝剥茧C语言(高阶)指针进阶练习
- 海思芯片(hi3516dv300)uboot镜像生成过程详解
- Example of Pushlet using handle of Pushlet
- 深度学习花书+机器学习西瓜书电子版我找到了
- gatk4中的interval是什么??
- Advanced level of C language (high level) pointer
猜你喜欢

面试结束后,被面试官在朋友圈吐槽了......

Outsourcing for three years, abandoned

English translation is too difficult? I wrote two translation scripts with crawler in a rage

抽丝剥茧C语言(高阶)数据的储存+练习

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

Leetcode-206. Reverse Linked List

Tencent's one-day life

记一个并发规则验证实现

外包干了三年,废了...

聊聊异步编程的 7 种实现方式
随机推荐
Tongda injection 0day
抽丝剥茧C语言(高阶)指针进阶练习
JS plot flot application - simple curve
Sqlmap tutorial (IV) practical skills three: bypass the firewall
微信小程序中的路由跳转
1142_ SiCp learning notes_ Functions and processes created by functions_ Linear recursion and iteration
一、Go知识查缺补漏+实战课程笔记 | 青训营笔记
解决could not find or load the Qt platform plugin “xcb“in ““.
外包幹了三年,廢了...
Music | cat and mouse -- classic not only plot
Gslx680 touch screen driver source code analysis (gslx680. C)
按键精灵脚本学习-关于天猫抢红包
Implementing data dictionary with JSP custom tag
KBU1510-ASEMI电源专用15A整流桥KBU1510
Leetcode-206. Reverse Linked List
[semantic segmentation] - multi-scale attention
电商常规问题part1
JS get all date or time stamps between two time stamps
Outsourcing for three years, abandoned
Convolutional neural network -- understanding of pooling