在测试mybatis Generator的时候 遇到的问题如下
Exception in thread “main” java.sql.SQLException: The server time zone value ‘�й���ʱ��’ is unrecognized or represents more than one time zone.
该错误为系统时间错误 需要在配置mysql的配置文件中加上serverTimezone=UTC
完整代码如下:
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/foodshopdemo?useSSL=false&serverTimezone=UTC"
userId="root"
password="root">
</jdbcConnection>
mysql8.0之后驱动注册改为com.mysql.cj.jdbc.Driver
参数的连接为& a m p;去掉中间空格