当你运行程序出来这个警告时:

Sun Jul 12 12:06:56 CST 2020 WARN: Establishing SSL connection without server’s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn’t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to ‘false’. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

别急

让我猜猜

你的连接数据库的url是不是也这样写的
在这里插入图片描述
在这里插入图片描述

用我蹩脚的英语给你翻译一波

Sun Jul 12 12:06:56 CST 2020警告:不建议在没有服务器身份验证的情况下建立SSL连接。根据MySQL 5.5.45 +,5.6.26 +和5.7.6+的要求,如果未设置显式选项,则默认情况下必须建立SSL连接。为了与不使用SSL的现有应用程序兼容,将verifyServerCertificate属性设置为’false’。您需要通过设置useSSL = false来显式禁用SSL,或者设置useSSL = true并为服务器证书验证提供信任库。

现在,当你看到了中文翻译,是不是突然知道如何解决咯
呐,就这样,就阔以了

url: jdbc:mysql://localhost:3306/test1?useSSL = false

but,为了保证万无一失
送你一个锦囊
在这里插入图片描述

把url改成这样

url: jdbc:mysql://localhost:3306/test1?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&useSSL=false

这句话可以帮你避免好多坑,谁用谁知道!

Logo

更多推荐