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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/why15732625998/article/details/78898536

连接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
展开阅读全文

没有更多推荐了,返回首页