SpringBoot项目常见异常:The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically

提示错误:

Loading class 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.

原因:

出现该问题是因为,运行springboot时jdbc驱动包报错,通过上网查询发现是jdbc依赖版本的问题,我查看了pom文件发现jdbc依赖的版本是8.x的版本。

解决办法:

版本更改成了5.X.X,启动就不报错了。

你可能感兴趣的:(spring,boot,常见问题)