当前位置:网站首页>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
注释了的是以前的;新的是修改后的;
希望可以帮助到大家;
边栏推荐
猜你喜欢
记一个并发规则验证实现
Stockage et pratique des données en langage C (haut niveau)
外包幹了三年,廢了...
Convolutional neural network -- understanding of pooling
Is the test cycle compressed? Teach you 9 ways to deal with it
ROS2规划系统plansys2简单的例子
[SUCTF 2019]Game
Jenkins远程构建项目超时的问题
After 95, Alibaba P7 published the payroll: it's really fragrant to make up this
抽絲剝繭C語言(高階)數據的儲存+練習
随机推荐
4、 High performance go language release optimization and landing practice youth training camp notes
1089: highest order of factorial
普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
知识点滴 - 关于苹果认证MFI
Tongda injection 0day
解决could not find or load the Qt platform plugin “xcb“in ““.
【云原生】内存数据库如何发挥内存优势
JSON introduction and JS parsing JSON
How to reduce inventory with high concurrency on the Internet
ROS2规划系统plansys2简单的例子
Tianqing sends instructions to bypass the secondary verification
四、高性能 Go 语言发行版优化与落地实践 青训营笔记
vus.SSR在asynData函数中请求数据的注意事项
IO流 file
Outsourcing for three years, abandoned
Jenkins远程构建项目超时的问题
idea添加类注释模板和方法模板
Rxjs - observable doesn't complete when an error occurs - rxjs - observable doesn't complete when an error occurs
Leetcode-206. Reverse Linked List
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?