在启动Sringboot项目时java连接mysql数据库时错误提示如下:
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.
翻译为:加载类“com.mysql.jdbc.Driver”。这已被弃用。新的驱动程序类是`com.mysql.cj.jdbc.Driver'。驱动程序通过 SPI 自动注册,通常不需要手动加载驱动程序类。
只需要在配置文件根据提示更改对应的加载驱动程序类即可
#更改为新的注册驱动程序
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver