The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than one time zone.

    技术2022-07-14  78

    报错原因是因为数据库时区问题

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

     

    在数据库连接后面拼接下面的语句即可

    &serverTimezone=UTC

     

    url: jdbc:mysql://localhost:3306/oneself?useUnicode=true&characterEncoding=UTF8&useSSL=false&serverTimezone=UTC

    Processed: 0.024, SQL: 9