警告:不建议在没有服务器身份validation的情况下建立SSL连接

连接MySQL数据库时,我收到以下警告:

建议不要在没有服务器身份validation的情况下建立SSL连接。 根据MySQL 5.5.45 +,5.6.26 +和5.7.6+要求如果未设置显式选项,则必须默认建立SSL连接。 为了符合不使用SSL的现有应用程序,verifyServerCertificate属性设置为“false”。 您需要通过设置useSSL = false显式禁用SSL,或者设置useSSL = true并为服务器证书validation提供信任库。

请帮我解决这个问题

import java.sql.*; public class JdbcCreateTable { public static void main(String args[]) { try { Class.forName("com.mysql.jdbc.Driver"); } catch(ClassNotFoundException e) { e.printStackTrace(); } try{ Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/INTtech","root","root"); Statement st=con.createStatement(); int i=st.executeUpdate("create table Author(AID int primary key,Aname varchar(20),AContact no int,ACountry string)"); System.out.println("Table is created"+i); con.close(); } catch(SQLException e) { e.printStackTrace(); } } } 

将useSSL = false放在名称数据库的末尾:

 Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/INTtech?useSSL=false","root","root");