使用mybatis链接数据库时出现如下错误,
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
很可能是没有配置好datasource,再配置文件主句库名称后添加如下设置后重试,
?serverTimezone=Asia/Shanghai
如果还有错误,执行下面命令更改数据库时区,问题解决。
set global time_zone = '+8:00';
set time_zone = '+8:00';
flush privileges;