今天在初学Mybatis的时候,预见了这样的问题,我和火箭班三个同学调整了两个多小时也没有调整明白。最后到基地陶小鱼给我弄好了。感触良多阿,感觉自己的调错能力正在崩溃。
错误信息
org.apache.ibatis.exceptions.PersistenceException:
### 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-config.xml 中的url配置修改为:
<property name="url" value="jdbc:mysql://localhost:3306/crud?serverTimezone=UTC"/>
即可解决。