连接MySQL报了一个时区的错误: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 if you want to utilize time zone support.
第一种方法
首先查看mysql的当前时区
使用的是系统时区,我们改为东八区,修改my.ini配置文件,加入
default-time_zone = '+8:00'
重启MySQL服务,再次查看time_zone
第二种方法
去datasource配置文件,加上:&serverTimezone=UTC
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC