mysql连接异常:The server time zone value '?й???????' is unrecognized or represents more than one

Posted 一眼千山,白驹掠影

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql连接异常:The server time zone value '?й???????' is unrecognized or represents more than one相关的知识,希望对你有一定的参考价值。

错误原因:mysql识别时区出现错误,这是因为访问的url中没有指定时区为UTC

出错误的url:

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springbootdemo?useUnicode=true&characterEncoding=utf8

在后面添加时区的参数数即可:

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springbootdemo?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC

 

以上是关于mysql连接异常:The server time zone value '?й???????' is unrecognized or represents more than one的主要内容,如果未能解决你的问题,请参考以下文章

mysql连接异常:The server time zone value '?й???????' is unrecognized or represents more than one

mysql异常之: The server time zone value ‘?D1ú±ê×?ê±??‘ is unrecognized or represents more than one time

ssm框架下 数据库连接异常 java.sql.SQLException: The server time zone value '???ú±&

eclipse连接mysql数据库提示The server time zone value 'Öйú±ê×¼&

MySql数据库时区异常,java.sql.SQLException: The server time zone value '?й???×¼

MySql数据库时区异常,java.sql.SQLException: The server time zone value '?й???×¼