今天在搭建mybatis環境時遇到錯誤,記錄一下
Caused by: 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.
引起:java.sql.SQLException:服務器時區值'Öйú±ê׼ʱ¼ä'無法識別或代表多個時區。 如果要使用時區支持,則必須配置服務器或JDBC驅動程序(通過serverTimezone配置屬性)以使用更具體的時區值。
解決方法:在jdbc連接後面加上serverTimezone=UTC
UTC是統一標準世界時間
jdbc:mysql://localhost:3306/mybatisdemo?serverTimezone=UTC
問題解決
剛開始努力學習的小白,大家也可以去看看我的個人博客
[南杜的博客](nandu.xyz)