插件mybatis-generator 出现The server time zone value '�й���׼ʱ��' is unrecogni的解决方法

报错
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以上的版本,然后就报了时区的错误

遇到的问题 servertime=UTC导致时间差8个小时

解决办法

在配置url的时候不能简单写成 :

jdbc:mysql://localhost:3306/mysql

而是要写成 :

jdbc:mysql://localhost:3306/mysql?serverTimezone=UTC
发布了48 篇原创文章 · 获赞 94 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/a458383896/article/details/100780833
今日推荐