mybatis解决 java.sql.SQLException: The server time zone value ‘�й���׼ʱ��‘ is unrecognized or repres

学习mybatis时做测试出现异常

Caused by: 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.

原因:java.sql.sql异常:服务器时区值’’``````````````````````````````````````````````````````````````````````````````````。如果要利用时区支持,则必须配置服务器或JDBC驱动程序(通过“serverTimezone”配置属性)以使用更具体的时区值。
这时候需要在配置数据库的url后面加上serverTimezone=GMT%2B8

dbc:mysql://localhost:3306/mybatis?serverTimezone=GMT%2B8

你可能感兴趣的:(java,mybatis,java,数据库)