运行代码时,报如下错误
ERROR com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException - HikariPool-1 - Exception during pool initialization.
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.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
该报错是因为.yml配置文件中url处未添加时区参数导致的
解决:
将url地址处加入参数 &serverTimezone=Asia/Shanghai 即可解决,如下所示
url: jdbc:mysql://localhost:3306/company?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai标签:zone,url,数据库,配置,Asia,关于,SQLError,time,serverTimezone From: https://www.cnblogs.com/stepforwardisdream/p/17647835.html