解決springboot項目啟動時提示mysql時區無法識別的問題


 

springboot mysql數據庫操作實例

啟動項目時,出現如下報錯:

The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. 

 

解決方案:

使用root用戶后台登錄mysql數據庫:

>mysql -u root -p
Enter password: *********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2109
Server version: 5.7.22-log MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables like '%time_zone%';

mysql> set global time_zone='+8:00';

退出后,重新登錄數據庫查詢時區,即更正成功。

重啟springboot項目后,啟動成功。

登錄數據庫,查詢創建的實體表person。

person表創建成功。

查看person表結構:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM