mybatis-generator 插件 报错 The server time zone value '?' is unrecognized or represents more than one

版权声明:本文为博主原创,转载请留言并标明出处 https://blog.csdn.net/qq_36355271/article/details/88555749

今天使用 IDEA 集成mybatis-generator 报错:

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.

意思:

服务器时区值“?”无法识别或表示多个时区。如果要利用时区支持,必须配置服务器或JDBC驱动程序(通过ServerTimeZone配置属性),以使用更具体的时区值。

解决办法:

一,在mysql中设置时区,默认为SYSTEM
set global time_zone=’+8:00’

二,在项目代码-数据库连接URL后,加上 (注意大小写必须一致)
jdbc.url=jdbc:mysql://127.0.0.1:3306/**?serverTimezone=UTC

在jdbc.properties 和generator.properties文件中如下修改:

修改前:

修改后:

猜你喜欢

转载自blog.csdn.net/qq_36355271/article/details/88555749
今日推荐