解决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-dev.properties

spring.datasource.url=jdbc:MysqL://localhost:3306/test?serverTimezone=GMT%2B8
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.MysqL.jdbc.Driver

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

spring.datasource.url=jdbc:MysqL://localhost:3306/test?serverTimezone=GMT%2B8
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.MysqL.cj.jdbc.Driver

 

猜你在找的Spring相关文章