mysql从数据库查询出来的时间与数据中实际的时间相差8小时(时区问题)
在SpringBoot使用mybatis进行MySQL操作的时候,发现select数据时,从数据库中拿出的数据总比数据库中的要多8个小时
搜索一些相关的博客找到了原因,是因为在application.properties配置文件中对mabatis配置连接信息中的serverTimezone设置问题
spring.datasource.url=jdbc:mysql://localhost:3306/ms_fitness_reservation?useUnicode=true&characterEncoding=utf8&allowMultiQueries