報錯: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; 刷新權限
然后退出后重新登錄就可以了,顯示當前時間和我現在的時間一致了。