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. 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.mysql

这个问题是升级完MySQL的连接驱动后出现的问题:sql

  升级前版本的jdbc配置url

  jdbc.driverClass = com.mysql.dbc.Driver
  jdbc.url = jdbc:mysql://127.0.0.1:3306/test?useSSL=false&useUnicode=true&characterEncoding=utf-8
  jdbc.username = root
  jdbc.password = root

code

  升级后按照最新官方提示支持将com.mysql.jdbc.Driver  改成  com.mysql.cj.jdbc.Driverserver

  jdbc.driverClass = com.mysql.cj.jdbc.Driverutf-8

  jdbc.url = jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone = GMT(这个连接方式也要改变)
  jdbc.username = root
  jdbc.password = root
 class

相关文章
相关标签/搜索