SpringBoot項目鏈接MYSQL的時區問題

在啓動SpringBoot項目的時候報錯:java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support. 緣由是MYSQL時區配置不正確。
打開MYSQL的配置文件my.cnf或者my.ini,在[mysqld]區塊追加時區配置:java

[mysqld]
default-time_zone='+8:00'

而後重啓MYSQL服務便可。mysql

相關文章
相關標籤/搜索