Loading class `com.mysql.jdbc.Driver'. The new driver class is `com.mysql.cj.jdb解决方法

版权声明:最终解释权归属Hern、HernSong(hernsong)、苍鹭、www.hernsong.com所有! https://blog.csdn.net/qq_36761831/article/details/87536800

抛异常的主要信息

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.

原因

MySQL8.0不在使用旧版的连接驱动。

解决方法

MySQL官方提示信息是将com.mysql.jdbc.Driver  改为  com.mysql.cj.jdbc.Driver

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/数据库名称?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
##jdbc:mysql://127.0.0.1:3306/db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
jdbc.username=数据库连接名
jdbc.password=数据库连接密码

猜你喜欢

转载自blog.csdn.net/qq_36761831/article/details/87536800
今日推荐