在编程路上遇到的问题 记录下
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.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127)
该错误为是系统时间错误
只需要在访问数据库的Url后面加上以下的语句即可:
?serverTimezone=GMT%2B8
例如URL为:
jdbc:mysql://localhost:port/test
改为:
jdbc:mysql://localhost:port/test?serverTimezone=GMT%2B8
推荐一种更改时区的方法:
还有一种方法就是:降低mysql的版本