JDBC连接mysql出现The server time zone value '�й���׼ʱ��' is unrecognized

JDBC连接mysql时出现问题:

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 specific time zone value if you want to 
utilize time zone support.

解决:

在 URL 后面加上 ?serverTimezone=UTC 如下:

jdbc:mysql://localhost:3306/db1?serverTimezone=UTC

 

posted on 2020-12-16 16:32  wnotes  阅读(171)  评论(0编辑  收藏  举报