idea创建spring-boot出现[ERROR]Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugi

idea创建spring-boot出现[ERROR]Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.5:generate (default-cli) on project mf-dao: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

解决办法:
1、在命令行中找到自己的mysql路径
在这里插入图片描述
2、在路径下输入mysql -u root -p 然后输入密码
idea创建spring-boot出现[ERROR]Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugi_第1张图片
3、登录mysql成功后,通过以下命令查询Time Zone,显示如图(SYSTEM为SQL默认美国时间,而我们中国要比他们迟8小时)
idea创建spring-boot出现[ERROR]Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugi_第2张图片
4、修改默认时间:set global time_zone=’+8:00’;
在这里插入图片描述
5、设置完重新打卡命令行,进入mysql,查询time,看是否修改成功
idea创建spring-boot出现[ERROR]Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugi_第3张图片
完成后,上面的问题就解决了。

类似的问题有三个 都发到我的博客上了。看着类似,其实是三个不一样的问题 查询时干扰的我搞了好久。所以我分开写了,希望能帮到各位。

你可能感兴趣的:(idea创建spring-boot出现[ERROR]Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugi)