Skip to content

MySql The server time zone value '?й???׼ʱ?' is unrecognized or represents more than one time zone.

🏷️ MySQL

连接 MySql 时出现如下异常:

com.mysql.cj.exceptions.InvalidConnectionAttributeException: 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 后加上 ?serverTimezone=UTC 即可修复这个异常。