数据库
首页 > 数据库> > java.sql.SQLException: The server time zone value �й���׼ʱ�� is unrecognized or represents ...

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

作者:互联网

使用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

标签:represents,jdbc,java,zone,value,server,time,3306
来源: https://blog.csdn.net/sinat_31089473/article/details/106164878