java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more
新版本数据库MySQL8.0.12出现:
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)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:87)
我们只需要在访问数据库的Url后面加上以下的语句即可:
?serverTimezone=GMT%2B8
比如,我原来的url是:
jdbc:mysql://localhost:3306/miaosha
修改为:
jdbc:mysql://localhost:3306/miaosha?serverTimezone=GMT%2B8
———————
作者:无心之事
来源:CSDN
原文:https://blog.csdn.net/u011702479/article/details/82118113
版权声明:本文为博主原创文章,转载请附上博文链接!