今天写东西测试的时候发现一个问题,如下:

application.yml中数据源是这样配置的:

第一反应就是记忆中连接mysql的驱动不都是com.mysql.jdbc.Driver吗?com.mysql.cj.jdbc.Driver是什么鬼?
后来查看了一下才知道 这个跟驱动的依赖版本有关
|
1 2 3 4 5 |
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> |

com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
from:https://blog.csdn.net/weixin_43770545/article/details/90486809