加载类`com.mysql.jdbc.Driver'.这已被弃用.新的驱动程序类是`com.mysql.cj.jdbc.Driver'

2021-12-21 00:00:00 mysql jdbc

这是控制台中的警告,我对此警告感到困惑:

This is the Warning im getting in console, Im confused with this warning:

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.

推荐答案

我通过更改application.properties of

spring.datasource.driver-class-name=com.mysql.jdbc.Driver

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

希望对你有帮助

相关文章