Error querying database. Cause: 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.
Mybatis在连接数据库时出现上述情况,在SqlMapConfig.xml中,
没修改前:
<property name="url" value="jdbc:mysql://localhost:3306/test">
修改后:
<property name="url" value="jdbc:mysql://localhost:3306/test?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8"/>
即加上,?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8