利用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........

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

即可。

相关文章:

  • 2021-04-04
  • 2021-04-05
  • 2022-12-23
  • 2021-05-27
  • 2021-09-16
猜你喜欢
  • 2022-12-23
  • 2021-09-12
  • 2021-07-07
  • 2021-10-31
  • 2021-10-21
  • 2022-12-23
  • 2021-06-03
相关资源
相似解决方案