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:129)
由错误信息可知:无法检查表是否已经使用元数据显示,在创建表的时候,不能正常连接,在往下看,The server time zone value ,关于这个版本,在Mysql服务的新版中种最为常见,因为我使用的环境为最新的MySLQ社区版8.0.11,在新版的数据库使用的时区与本地时区有区别,标准时区使用的是Unix元年的时间为起始点到当前时间中间所做的动作。国际标准失去与本地相差 8 个小时。
解决的方法是在原来的url后添加 ?serverTimezone=UTC
原来的url:
改变后的url: