一,修改配置
show variables like '%time_zone%'; //查詢當前時區 set global time_zone='+8:00'; //在標准時區上加+8小時,即東8區時間 flush privileges; # 立即生效
二,修改數據庫連接
spring.datasource.url=jdbc:mysql://10.35.105.25:3306/database?characterEncoding=utf-8&serverTimezone=GMT%2B8
數據庫配置后面加上 &serverTimezone=GMT%2B8