【错误提示】
在springboot+springcloud框架中,做CURD时报错:
java.sql.SQLException:The server time zone value ‘�й���ʱ��’ is unrecognized or represents more than onetime zone. You must configure either the server or JDBC driver (via theserverTimezone configuration property) to use a more specifc time zone value ifyou want to utilize time zone support.
【解决方法】
在application.yml文件中配置数据源的时候,添加时区信息(?后面的部分):
#配置数据源
spring:
datasource:
url: jdbc:mysql:///hqing1-2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username:-----
password: -----