背景介绍:

把项目在新的电脑上运行,MySQL版本不同出现错误

错误:

报错The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone. You must...

原因:

是使用了Mysql Connector/J 6.x以上的版本,然后就报了时区的错误

解决方法:

在配置url的时候不能简单写成 :

jdbc.url=jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=utf8&useSSL=false

改写成 :

jdbc.url=jdbc:mysql://localhost:3306/demo?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false

相关文章:

  • 2021-11-01
  • 2021-08-12
  • 2021-09-10
  • 2021-12-16
  • 2022-12-23
  • 2021-10-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2021-06-23
  • 2021-12-19
  • 2021-07-06
相关资源
相似解决方案