在使用jdbc连接数据库的时候,出现了一个警告。
内容是:
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.
研究了一下说的意思,大概就是MYSQL 5.5.45+, 5.6.26+ and 5.7.6+版本默认连接的时候要求SSL连接,但是我在连接的时候并没有使用ssl。
根据后面的提示,在连接jdbc的时候,最后面加上useSSL=false即可。
本文针对使用JDBC连接MySQL时出现的SSL警告问题进行了探讨。在MySQL 5.5.45及以上版本中,默认要求建立SSL连接。如果应用程序不使用SSL,则需要通过设置useSSL=false来显式禁用SSL。
419

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



