报错
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.
解决
添加serverTimezone=UTC
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC"></property>
本文解决了因服务器时区配置不正确导致的java.sql.SQLException异常问题。通过在连接字符串中明确指定时区为UTC,成功避免了时区冲突引发的错误。
2452

被折叠的 条评论
为什么被折叠?



