Java报错-java.sql.SQLException: The server time zone value

Issue

在这里插入图片描述

Answer

这是因为MySQL的版本是8.0以上的版本缘故,需要在连接数据库的url后面加上以下语句“?serverTimezone=GMT%2B8”

private static String url = "jdbc:mysql://localhost:3306/world?serverTimezone=GMT%2B8";

猜你喜欢

转载自blog.csdn.net/JavaDestiny/article/details/86530037
今日推荐