JDBC Mysql8.0报错The server time zone value ‘?й??? is unrecognized or represents more than one time z
is unrecognized or represents more than one time zone. You must configure either the server 。。。
这个报错是时区的问题,解决的办法有两种,一种是去mysql中SET GLOBAL time_zone = '+8:00'
即把时区改为东八区。
或者是在jdbc的链接串中,带上如下信息"jdbc
//localhost/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC"
其中useLegacyDatetimeCode默认开启,关闭后时区相关信息会失效。
还没有评论,来说两句吧...