idea连接数据库报错 Server returns invalid timezone. Need to set‘serverTimezone’property
原因是MySQL驱动中默认时区是UTC,与本地时间(中国)相差八个小时,所以链接不上。
解决时区问题:
url改为
jdbc:mysql://localhost:3306/database?serverTimezone=GMT
idea连接数据库报错 Server returns invalid timezone. Need to set‘serverTimezone’property
原因是MySQL驱动中默认时区是UTC,与本地时间(中国)相差八个小时,所以链接不上。
解决时区问题:
url改为
jdbc:mysql://localhost:3306/database?serverTimezone=GMT