启动项目报以下异常 (正在加载类“com.mysql.jdbc.driver”。这已被弃用)
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.
是因为配置参数变动:
原:spring.datasource.driver-class-name=com.mysql.jdbc.Driver
改:spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
运行时报如下异常 (在写数据库相关项目时,出现The server time zone value '�й���ʱ��' is unrecogni异常。)
java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
是因为配置参数变动:
原:spring.datasource.url=jdbc:mysql://127.0.0.1:3306/how2java?characterEncoding=UTF-8
改:spring.datasource.url=jdbc:mysql://127.0.0.1:3306/how2java?serverTimezone=UTC&characterEncoding=UTF-8
启动项目报以下异常 (正在加载类“com.mysql.jdbc.driver”。这已被弃用)Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered vi...