连接MySQL数据库报时区错误:java.sql.SQLException: The server time zone value

连接MySQL数据库时报以下时区错误信息:

java.sql.SQLException: 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.

解决办法:
在连接mysql的JDBC的url后面加上服务器的时区:serverTimezone=UTC即可。

jdbc_url=jdbc:mysql://localhost:3306/why?useUnicode=true
&characterEncoding=UTF-8&serverTimezone=UTC

你可能感兴趣的:(꧁数据库꧂,♚✡✡✡✡✡✡♚【MySQL】)