异常信息
1 | Exception in thread "main" 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. |
异常原因
在配置连接数据库的url时,未配置时区
解决方法
数据库后面需要跟?serverTimezone=UTC,如:jdbc:mysql:///mysqltest?serverTimezone=UTC
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 123!