to report a time zone exception when MyBatis connection to a database configuration file
The server time zone value ' Йʱ ' was unrecognized or represents more than one time zone. You are must configure either the server or JDBC driver (via the Servertimezone configuration) to use a more specifc Time zone value if your want to utilize time zone support.
This is my profile mybatis_generator.properties
Jdbc.type=mysql
jdbc.driverClassName:com.mysql.cj.jdbc.Driver
jdbc.url:jdbc:mysql://127.0.0.1:3306/ Test_springboot?useunicode=true&characterencoding=utf-8&allowmultiqueries=true
Jdbc.username=root
jdbc.password=linford
jdbc.pool.minidle=8
jdbc.pool.maxactive=100
generator.classpath=d:\ Develop\develop_jar\web\mysql-connector-java-5.1.30.jar
Generator.mapperconfigfilename=mapper-config.xml
Generator.targetproject=springbootdemo_maven
Generator.domainpackage=com.linford.bean
Generator.mapperpackage=com.linford.mapper
Generator.daopackage=com.linford.dao
This is because my MySQL-driven version is more than 6.0
<dependency>
<groupId>mysql</groupId>
<artifactid>mysql-connector-java</ artifactid>
<version>6.0.6</version>
</dependency>
You need to add "SERVERTIMEZONE=UTC" to Jdbc.url, or you will get an error on the time zone issue, which is used CTT China Taiwan time zone to avoid 8-hour jet lag modifications:
jdbc.url:jdbc:mysql://127.0.0.1:3306/test_springboot?servertimezone=ctt&useunicode=true& Characterencoding=utf-8&allowmultiqueries=true