1. 程式人生 > >SpringBoot——Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.

SpringBoot——Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.

報錯的資訊為:

這是因為更換了最新的MySQL驅動

之前的是:

jdbc.driverClass   = com.mysql.dbc.Driver
jdbc.url      = jdbc:mysql://127.0.0.1:3306/db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
jdbc.username = root
jdbc.password = root

 現在的改成了這樣:

按照最新官方提示支援將com.mysql.jdbc.Driver  改為  com.mysql.cj.jdbc.Driver

jdbc.driverClass   = com.mysql.cj.jdbc.Driver
jdbc.url      = jdbc:mysql://127.0.0.1:3306/db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
jdbc.username = root
jdbc.password = root