mysql启动报错 Loading class `com.mysql.jdbc.Driver‘. This is deprecated. The new driver class is `com.my

tech2022-07-05  232

问题1:mysql启动报错 Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

报错原因是配置文件的driver-class-name用了旧的,新的驱动已经进行修改: 旧的:com.mysql.jdbc.Driver 新的: com.mysql.cj.jdbc.Driver 把驱动换成新的旧不会报错了。

问题2:Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is 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.

报错问题是配置文件连接数据库的url问题: 没改之前的url:jdbc:mysql://localhost:3306/自己的数据库 解决方案 url: jdbc:mysql://localhost:3306/dm_svr?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

最新回复(0)