异常
`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.`
原配置文件
解决方法:
url设置一个serverTimezone的参数,值可以是GMT-8,也可以是Asia/Shanghai
,因为GMT-8需要转义连字符"-",所以转移后变成GMT%2B8,如果是Asia/Shanghai就无须做转换了
spring:
datasource:
url: jdbc:mysql://localhost:3306/springboot?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: root
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
schema:
- classpath:sql/spring_user.sql