项目场景:
项目场景:springboot和vue的基础增删改查以及分页时遇见的数据库版本依赖bug
问题描述
提示:这里描述项目中遇到的问题:
bug:Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is
com.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
:
原因分析:
bug解决:解决数据库依赖问题,看配置文件需要根据当前项目数据库版本,由于我的本机使用的mysql5.7的数据库所以需要修改对应版本使用的方式为如下:
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
如下为Mysql5.7基于springboot的yml文件的链接配置信息
server:
port: 8080
spring:
datasource:
# 使用druid数据源(5.7)
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC
username: root
password: root