Java连接mysql数据库出现The server time zone value '?й???????' is unrecogni的解决

Posted 踏花自在天

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java连接mysql数据库出现The server time zone value '?й???????' is unrecogni的解决相关的知识,希望对你有一定的参考价值。

Mysql版本:8.0.17

在为MyBatis添加数据源配置时,在application.yml文件中添加了mysql数据源连接信息。

 

运行代码生成类报错,The server time zone value \'�й���׼ʱ��\' is unrecognized or represents more than one time zone.

 

 

 

解决方法:在配置文件中的数据库url中添加serverTimezone=UTC参数即可解决。

 

 

 

 

以上是关于Java连接mysql数据库出现The server time zone value '?й???????' is unrecogni的解决的主要内容,如果未能解决你的问题,请参考以下文章

IDEA连接mysql数据库发生的错误! Server returns invalid timezone. Go to 'Advanced' tab and set 'serv

偶尔出现 unable to connect to any of the specified MySQL hosts 是怎么回事

报错:An error occurred at line: 22 in the generated java file The method getJspApplicationContext(Serv

报错处理:Cause: java.sql.SQLException: The server time zone value

报错处理:Cause: java.sql.SQLException: The server time zone value

远程连接mysql root账号报错:2003-can't connect to MYSQL serve