java.sql.SQLException: The server time zone value xx is unrecognized or represents more than one time zone.

这个报错是由于连接数据版本问题,在连接数据库库的url加上:

?serverTimezone=UTC

  如下:

spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://localhost:3306/test?serverTimezone=UTC
    username: root
    password: 1234

  

posted @ 2021-11-17 17:47  shadow321  阅读(18)  评论(0编辑  收藏  举报