java连接mysql出现The server time zone value '�й���׼ʱ��' is unrecognized的解决方法

java连接mysql出现The server time zone value '�й���׼ʱ��' is unrecognized的解决方法

在Idea中连接数据库是抛出The server time zone value ‘�й���׼ʱ��’ is unrecogni错误 原因是因为使用了Mysql Connector/J 6.x以上的版本,然后就报了时区的错误。

解决办法在配置url中添加serverTimezone=UTC


jdbc:mysql://localhost:3306/test1?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC

发布了21 篇原创文章 · 获赞 9 · 访问量 4519

猜你喜欢

转载自blog.csdn.net/qq_36470898/article/details/96321989
今日推荐