错误信息如下:
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。。。
错误原因:mysql识别时区出现错误,这是因为访问的url中没有指定时区为UTC
出错误的url:
jdbc.url=jdbc:mysql://localhost:3306/seckill?useUnicode=true&characterEncoding=utf8
在后面添加时区的参数数即可:
jdbc.url=jdbc:mysql://localhost:3306/seckill?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC

本文介绍了如何解决MySQL连接时出现的时区配置错误问题。通过在连接URL中明确指定时区为UTC,可以避免因时区设置不当导致的数据同步问题。

341

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



