解决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

 

异常:

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

猜你喜欢

转载自www.cnblogs.com/heshaoye/p/12082290.html
今日推荐