Regarding the inconsistency between the Mysql database time and the query time

Reason: The time zone used by Mybatis to connect to Mysql URL is inconsistent with that used by Mysql

url: jdbc:mysql://127.0.0.1:3306/searchall?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC

The URL isserverTimezone=UTC

Solution: Modify spring.datasource.url back serverTimezone=UTCto serverTimezone=Asia/Shanghaiit.

Guess you like

Origin blog.csdn.net/qq_39655510/article/details/112912794