解决Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'.

解决:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'.

异常:

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. 

整合spring boot项目过程中出现的,用了最新的mysql 连接驱动

application.yml

spring:
application:
name: test
datasource:
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: root
password: root

需要将 com.mysql.jdbc.Driver  改为  com.mysql.cj.jdbc.Driver

spring:
application:
name: test
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://127.0.0.1.61:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: root
password: root

 

posted @ 2019-12-23 10:03  崛起吧少年  阅读(1717)  评论(0编辑  收藏  举报