错误:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.c

这是由于mysql驱动包跟新的缘故,不能再使用以前旧的mysql驱动包。

根据提示,更改相应的驱动包就可以了。

这个驱动更新还可能会引发一个错误:

java.sql.SQLNonTransientConnectionException: Cannot load connection class because of underlying exception: com.mysql.cj.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near ';characterEncoding=utf-8'

解决办法:

之前:jdbc:mysql://localhost:3306/tree?useUnicode=true&characterEncoding=utf-8

现在:jdbc:mysql://localhost:3306/tree?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone = GMT

将之前的链接改成现在的链接后,就不会出现这个问题。

发布了241 篇原创文章 · 获赞 94 · 访问量 13万+

猜你喜欢

转载自blog.csdn.net/weixin_41060905/article/details/102974713
今日推荐