我今天把mysql jar包由5.0 换成了 8.0 之后启动SpringBoot的时候报错:

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.

参考这篇文章:

https://blog.csdn.net/u011250186/article/details/103804464

抛出异常是因为MySql服务器时区(继承自系统时区)的格式与mysql连接器所期望的格式不同。最简单的修改方法:将配置后添加:serverTimezone=GMT%2B8

修改前:The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone

修改后:
The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone

运行成功!
The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone

相关文章:

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