mysql time zone時區的錯誤解決


 

錯誤提示:

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

 

完整的錯誤提示:

There was an unexpected error (type=Internal Server Error, status=500).
nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is 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. ### The error may exist in file [D:\XXXX\Dev\Java\SSM\MONTH_1901\springboot-manage-master\target\classes\mapper\UserMapper.xml] ### The error may involve com.shop_manager.mapper.UserMapper.selectByNameAndPwd ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is 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.
 
解決辦法:

cmd下輸入如下命令進行操作

//登錄

mysql -u root -p

 

//查看mysql系統時間。和當前時間做對比

select now();

 

//查看系統時區

show variables like '%time_zone%';

 

// 設置時區,更改為東八區

set global time_zone = '+8:00';

 

// 刷新權限

flush privileges;

 

 

 
 
參考文章
 


免責聲明!

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



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