错误
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.

解决方法
这个问题是因为我们使用SpringInitizar创建项目时选择的MySQL驱动程序的版本(默认是高版本)过高;在pom文件里点击选中并点击mysql-connector-java,跳转以后可以看到驱动程序的版本;

1、在pom文件中指定MySql驱动程序的版本;
2、在url后面加上这个&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC;
本文详细解释了在使用Spring Initializr创建项目时遇到的MySQL时区错误‘�й���ʱ��’的问题,该问题源于所选MySQL驱动程序版本过高。文章提供了两种解决方案:一是指定MySql驱动程序的版本,二是在url中添加特定参数。
3574

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



