springboot项目数据库时区不对导致报错,如何解决?

img

与目标 VM 断开连接, 地址为: ''127.0.0.1:50560',传输: '套接字''

进程已结束,退出代码1

端口情况:

img

启动的控制台找到了一行报错:

img

java.sql.SQLException: 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.

已经尝试解决办法:
1.加上 ?serverTimezone=UTC
可能加的语法不对,所以附图

img

结果:

img


依然跑不了,退出代码1
错误仍然存在

img

修改下你的时区的配置,一般配置为 UTC+8