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.
翻译一下:
警告:不推荐使用无服务器身份认证的SSL连接(Secure Sockets Layer 安全套接层,一种安全协议)。MySQL 5.5.45+, 5.6.26+ and 5.7.6+ 版本规定,如果没有进行设置,SSL默认进行连接。考虑到有些已经存在的程序没有使用SSL,verifyServerCertificate 属性应该设置为false。你可以通过设置useSSL=false来禁用SSL,或者设置useSSL=true并提供信任证书。
上面已经给出了解决方法,只需要在连接数据库URL后面多加一个参数就可以了,以Spring项目为例
<bean id="druidDataSource3309" class="com.alibaba.druid.pool.DruidDataSource">
<!--加参数方式url?参数名=参数值-->
<property name="url" value="jdbc:mysql://192.168.235.128:3306/test?useSSL=false"/>
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
</bean>