MySQL时区问题
SpringBoot 连接MySQL报错:
Wed Jan 16 17:58:27 CST 2019
There was an unexpected error (type=Internal Server Error, status=500).
Failed to obtain JDBC Connection; nested exception is 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.
这是时区设置有问题:
specifc time zone value需要指定时区
从命令行打开MySQL
show variables like '%time_zone%';
set global time_zone = '+8:00';
异常解决——The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more than one
解决MySQL时区配置错误
本文详细解析了SpringBoot连接MySQL时报错的问题,主要原因是服务器时区设置不正确。通过命令行修改MySQL服务器时区为'+8:00',成功解决了Theservertimezonevalue错误,确保了时间和日期的准确处理。
971

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



