我今天把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.youkuaiyun.com/u011250186/article/details/103804464
抛出异常是因为MySql服务器时区(继承自系统时区)的格式与mysql连接器所期望的格式不同。最简单的修改方法:将配置后添加:serverTimezone=GMT%2B8
修改前:
修改后:
运行成功!