idea關聯mysql時報時區錯誤
- 2019 年 12 月 2 日
- 筆記
Server returns invalid timezone. Go to 'Advanced' tab and set 'serverTimezone' property manually.

MySQL默認的時區是UTC時區,比北京時間晚8個小時,所以要修改mysql的時長。
Win+R進入Dos窗口(配置了MySql環境變數),輸入:mysql -u root -p
輸入密碼,進入mysql。
輸入:set global time_zone=』+8:00』;
再次連接成功:

當然方法不止這一種,這種方法也不是永久的,重啟後就會失效。
