1. 程式人生 > >異常: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or J

異常: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or J

異常:

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 連線 MySQL 時連線不上
解決:

修改資料庫時區
1.在mysql中執行如下語句
set global time_zone='+8:00';
2.修改資料庫連線的url,加上如下引數(指定時區):
serverTimezone=GMT