问题1:驱动过期
Loading class `com.mysql.jdbc.Driver’. This is deprecated
问题:com.mysql.jdbc.Driver已经过期,
使用新的驱动com.mysql.cj.jdbc.Driver 即可
问题2:url时区参数
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
问题:url后面没有带时区参数
解决:在连接url后面加上参数 ?serverTimezone=GMT%2B8
本文解决两个常见MySQL连接问题:一是旧驱动com.mysql.jdbc.Driver过期,应替换为com.mysql.cj.jdbc.Driver;二是连接URL缺少时区参数导致SQLException,需在URL后添加?serverTimezone=GMT%2B8。
400

被折叠的 条评论
为什么被折叠?



