JDBC连接M有SQL数据库报错The server time zone value '???ú±ê×??±??' is unrecognized or represents........

利用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.具体错误如图所示:

JDBC连接M有SQL数据库报错The server time zone value '???ú±ê×??±??' is unrecognized or represents........_第1张图片

解决办法:mysql返回的时间总有问题,一般总是早8小时。String url = "jdbc:mysql://localhost:3307/mysql_xy?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false";

即可。

你可能感兴趣的:(MySQL,mysql)