当前位置:网站首页>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
注释了的是以前的;新的是修改后的;
希望可以帮助到大家;
边栏推荐
- Make a bat file for cleaning system garbage
- Convolutional neural network -- understanding of pooling
- 外包干了四年,废了...
- JS small exercise ---- time sharing reminder and greeting, form password display hidden effect, text box focus event, closing advertisement
- 普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
- Flexible layout (I)
- Jenkins远程构建项目超时的问题
- gatk4中的interval是什么??
- 今日现货白银操作建议
- Outlier detection technology of time series data
猜你喜欢
[SUCTF 2019]Game
二、并发、测试笔记 青训营笔记
[2022 ACTF]web题目复现
机器人技术创新与实践旧版本大纲
buuctf misc USB
Calculus key and difficult points record part integral + trigonometric function integral
考研失败,卷不进大厂,感觉没戏了
Cloud backup project
Simple example of ros2 planning system plansys2
L'étape avancée du pointeur de langage C (haut de gamme) pour l'enroulement des cocons
随机推荐
按键精灵脚本学习-关于天猫抢红包
测试周期被压缩?教你9个方法去应对
How do I get the last part of a string- How to get the last part of a string?
【经验分享】如何为visio扩展云服务图标
2、 Concurrent and test notes youth training camp notes
Leetcode-226. Invert Binary Tree
The metauniverse of the platofarm farm continues to expand, with Dao governance as the core
Rxjs - observable doesn't complete when an error occurs - rxjs - observable doesn't complete when an error occurs
1140_ SiCp learning notes_ Use Newton's method to solve the square root
基于Flask搭建个人网站
leetcode:105. 从前序与中序遍历序列构造二叉树
Make a bat file for cleaning system garbage
Redis data migration
微博发布案例
解决:Could NOT find KF5 (missing: CoreAddons DBusAddons DocTools XmlGui)
JS small exercise ---- time sharing reminder and greeting, form password display hidden effect, text box focus event, closing advertisement
Determining the full type of a variable
直播平台源码,可折叠式菜单栏
抽絲剝繭C語言(高階)指針的進階
Simple example of ros2 planning system plansys2