从错误看应该是系统时间错误
警告:10:31:57 pool-14-thread-1 WARN [root] 错误代码:31300012 创建数据连接失败: 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.
SwingWorker-pool-12-thread-6 ERROR [root] 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.
这是在使用MySQL 8.0以上版本(MySQL连接驱动和版本都是8.0以上)的时候出现的问题错误,我们需要在访问数据库的Url后面加上以下的语句即可:
?serverTimezone=GMT%2B8
比如初始的url是
jdbc:mysql://localhost:3306/hgd
改成
jdbc:mysql://localhost:3306/hgd?serverTimezone=GMT%2B8
这样就能链接成功