问答详情
源自:2-2 JDBC实战---打通数据库

连接MySQL,eclipse运行以后出现这个怎么解决

Thu Aug 11 15:07:20 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.

小溪,22

提问者:SilenceDean 2016-08-11 15:31

个回答

  • qq_一路向左_0
    2016-08-11 17:54:21
    已采纳

    造成这个问题的原因是你用的Mysql版本过高,mysql在高版本中增加了数据加密技术,也就是SSL协议,在用户通过第三方软件连接时需要对连接信息进行SSL转换加密,而你提供的地址如果没有申明SSL转换,就会导致新版mysql无法识别,相当于你提供了错误的地址。解决方法是在url后面加上SSL申明useSSL=true。比如我这样:"jdbc:mysql://localhost:3306/zx?useUnicode=true&useSSL=true"