IDEA报错“java.sql.SQLException: The server time zone value”

IDEA reports an error
java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.

code show as below

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    username: root
    password: 123456
    url: jdbc:mysql://localhost:3306/beautyshopping?characterEncoding=utf8&serverTimeZone=UTC

It prompts me that the time zone is wrong, and then the value is garbled

Originally I used serverTimeZone=Asia/Shanghai. Later, I used &serverTimezone=UTC and serverTimezone=GMT%2B8 in the online tutorial, and it was fine.

Guess you like

Origin blog.csdn.net/yilingpupu/article/details/121910308