java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents morethan one time zone.
原因:MySql安装默认设置为美国时区
解决方法:在url里加上serverTimezone=UTC
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&autoReconnect=true&useUnicode=true&characterEncoding=utf8
jdbc.username=root
jdbc.password=123
另一种解决方式:https://www.jianshu.com/p/02f16bb0b9f1(感谢大佬,侵删)
本文详细介绍了如何解决在使用MySQL数据库时遇到的时区错误问题,通过在连接URL中添加serverTimezone参数来指定时区,例如使用UTC时区。此外,还提供了另一种可能的解决方案链接。
333

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



