mysql时区问题
查看时区:
show variables like '%time_zone%';
重新设置时区:
1:设置全局
set global time_zone='+8:00';
2:设置当前会话
set time_zone='+8:00';
3 :立即生效
flush privileges
;
这是一个例子mysql配置连接
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/mybatis_plus?serverTimeZone=GMT+8
spring.datasource.username=root
spring.datasource.password=123456