作者:cc_vb8 | 来源:互联网 | 2023-07-30 15:01
利用JDBC连接数据时,会报错误具:java.sql.SQLException: 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.具体错误如图所示:
解决办法:mysql返回的时间总有问题,一般总是早8小时。String url = "jdbc:mysql://localhost:3307/mysql_xy?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false";
即可。