java.sql.SQLException: The server time zone value �й���׼ʱ�� is unrecognized or represents ...

穿精又带淫゛_ 提交于 2020-08-10 02:38:18

使用springboot 整合mybatis项目启动控制台报错:

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 Connector/J 6.x以上的版本,然后就报了时区的错误,解决方法:

    在配置url的时候不能简单写成 :

    jdbc:mysql://localhost:3306/test
    而是要写成 :
    jdbc:mysql://localhost:3306/test?serverTimezone=UTC

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!