PInkDuck 2023-03-13 15:41 采纳率: 75%
浏览 26
已结题

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

  • 写回答

2条回答 默认 最新

  • threenewbee 2023-03-13 15:47
    关注

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 3月21日
  • 已采纳回答 3月13日
  • 创建了问题 3月13日