Mysql报警告:WARN: Establishing SSL connection Mysql报警告:WARN: Establishing SSL connection

转:https://blog.csdn.net/wangxilong1991/article/details/53515013

Mysql报警告:WARN: Establishing SSL connection

  • 警告信息

[root@X203 bin]# Thu Dec 08 10:18:13 CST 2016 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连接字符串url中加入ssl=true或者false即可,如:

jdbc:mysql://X203:3306/testdb?useUnicode=true&characterEncoding=utf8&useSSL=false
  
  
  • 1

备注
启用SSL加密连接后,性能必然会有下降。
由于SSL开销较大的环节在建立连接,所以短链接的开销可能会更大,因此推荐使用长连接或者连接池的方式来减小SSL所带来的额外开销,不过好在MySQL的应用习惯大部分也是长连接的方式。

总结
1.MySQL 5.7配置SSL要比5.6来的简单的多
2.MySQL 5.7客户端默认开启SSL加密连接
3.通常来说,开启SSL加密连接后,性能最大的开销在25%左右

猜你喜欢

转载自blog.csdn.net/hqbootstrap1/article/details/84564564
今日推荐