報錯:Cannot create PoolableConnectionFactory (The server time zone value 'CST' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverT


報錯:Cannot create PoolableConnectionFactory (The server time zone value 'CST' 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.)
---------------------
由於我的是win7系統,如下:

解決時區問題:

方法一:修改驅動:
jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=gbk&useSSL=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Hongkong

 

方法二:修改數據的時區:
select now(); 查看mysql系統時間。和當前時間做對比

set global time_zone = '+8:00';設置時區更改為東八區

flush privileges; 刷新權限

然后退出后重新登錄就可以了,顯示當前時間和我現在的時間一致了。


免責聲明!

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



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