java.lang.RuntimeException: 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后加入?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

在尝试使用Java连接MySQL数据库时遇到一个异常:InvalidConnectionAttributeException,原因是服务器不识别'The timezone value'ç…š±êשʱÇø'。解决办法是在URL后添加参数?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC,将服务器时区设置为UTC。

8954

被折叠的 条评论
为什么被折叠?



