Loading class `com.mysql.jdbc.Driver'. This is deprecated.
程序员文章站
2024-03-14 16:57:28
...
问题:
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.
1.出现这个问题就我而言是因为本地的mysql版本高,按照官方要求,更改他的driver
1.1更改前
#数据源配置
spring.datasource.username=root
spring.datasource.password=
spring.datasource.url=jdbc:mysql://localhost:3306/xxx?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false
#更改之前
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
1.2更改后
#数据源配置
spring.datasource.username=root
spring.datasource.password=
spring.datasource.url=jdbc:mysql://localhost:3306/xxx?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false
#更改后
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
2.问题解决
上一篇: MySQL错误:Access denied for user 'root'@'%' to database 'mytest'
下一篇: This XML file does not appear to have any style information associated with it. The document tree is
推荐阅读
-
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb
-
Loading class `com.mysql.jdbc.Driver'. This is deprecated.
-
spring boot单元测试类的使用.Loading class `com.mysql.jdbc.Driver'. This is deprecated.
-
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdb
-
浅析使用JDBC操作MySQL需要添加Class.forName("com.mysql.jdbc.Driver")
-
Cannot load driver class: com.mysql.jdbc.Driver
-
java.lang.IllegalStateException: Cannot load driver class: com.mysql.jdbc.Driver
-
spring boot 异常: Cannot load driver class: com.mysql.jdbc.Driver
-
Cannot load driver class: com.mysql.jdbc.Driver
-
Cannot load driver class: com.mysql.jdbc.Driver