java.sql.SQLException: The server time zone value ‘�й���ʱ��‘ is unrecognized or represents
springboot连接mysql报错,实际错误如下图所示:

测试后,解决方法如下:
在application中url后加上:
?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8
实测解决上述问题,连接正常。

本文解决了一个常见的SpringBoot应用在连接MySQL数据库时遇到的时区问题。通过在application配置文件的URL中添加特定参数,如serverTimezone、useUnicode和characterEncoding,成功解决了因时区设置不当导致的连接失败问题。
java.sql.SQLException: The server time zone value ‘�й���ʱ��‘ is unrecognized or represents
springboot连接mysql报错,实际错误如下图所示:

测试后,解决方法如下:
在application中url后加上:
?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8
实测解决上述问题,连接正常。

4761
2303
2万+
770
1102

被折叠的 条评论
为什么被折叠?