美文网首页
The server time zone value '��

The server time zone value '��

作者: Abbott思宇 | 来源:发表于2017-10-26 13:06 被阅读0次

    [TOC]

    参考阅读

    Hibernate连接MYSQL失败提示时区错误该怎么解决? - segmentfault
    MySQL Connector/J 6.x jdbc.properties 配置, mysql-connector-java-6.0.4.jar 异常 - cnbolg
    The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. - csdn
    【坑】The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone - cnbolg

    问题现象

    com.mysql.cj.core.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.

    解决方案

    方案1

    在项目代码-数据库连接URL后,加上 (注意大小写必须一致)?serverTimezone=UTC

    方案2

    在mysql中设置时区,默认为SYSTEM set global time_zone='+8:00'

    set global time_zone='+8:00';
    

    问题原因

    使用了Mysql Connector/J 6.x以上的版本,然后就报了时区的错误

    相关文章

      网友评论

          本文标题:The server time zone value '�й��

          本文链接:https://www.haomeiwen.com/subject/dqtkpxtx.html