起因:

程序在启动时,连接MySQL数据库,发出警告️:

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.

例如:

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/test","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();
}
}
}

解决:

Put the useSSL=false at the end of the name database:

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/test?useSSL=false","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();
}
}
}

解决MySQL在连接时警告:WARN: Establishing SSL connection without server's identity verificatio的更多相关文章

  1. MySQL 警告WARN: Establishing SSL connection without server's identity verification is not recommended.解决办法

    Fri Jun 17 13:46:54 CST 2016 WARN: Establishing SSL connection without server's identity verificatio ...

  2. Java连接MySQL报出警告 WARN: Establishing SSL connection without server's identity verification is not recommended.

    很多人使用JDBC连接MySQL时报出警告: WARN: Establishing SSL connection without server's identity verification is n ...

  3. SpringBoot------连接mysql时出现警告:Establishing SSL connection without server's identity verification is not recommended

    SpringBoot连接MySQL时出现警告: 英文: Mon Jun :: CST WARN: Establishing SSL connection without server's identi ...

  4. 【警告】WARN: Establishing SSL connection without server's identity verification is not recommended.

    1.Java访问Mysql时出现如下警告: 2019-04-02 10:30:50.545 INFO 1290 --- [nio-8080-exec-1] com.zaxxer.hikari.Hika ...

  5. MYSQL:WARN: Establishing SSL connection without server's identity verification is not recommended.

    WARN: Establishing SSL connection without server's identity verification is not recommended. Accordi ...

  6. 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 i

    jdbc连接数据库候,对数据进行访问,访问正常当出现如下警告: WARN: Establishing SSL connection without server's identity verifica ...

  7. Wed Sep 19 20:48:46 CST 2018 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 mus

    Wed Sep 19 20:48:46 CST 2018 WARN: Establishing SSL connection without server's identity verificatio ...

  8. Fri Jul 28 16:28:52 CST 2017 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 mus

    Fri Jul 28 16:28:52 CST 2017 WARN: Establishing SSL connection without server’s identity verificatio ...

  9. java链接Mysql出现警告: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

    Java使用mysql-jdbc连接MySQL出现如下警告: Establishing SSL connection without server's identity verification is ...

  10. SpringBoot+mybatis:报错Fri Oct 19 14:29:24 CST 2018 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+ requiremen

    报错:Fri Oct 19 14:29:24 CST 2018 WARN: Establishing SSL connection without server's identity verifica ...

随机推荐

  1. Vue + Element UI 实现复制当前行数据功能(复制到新增页面组件值不能更新等问题解决)

    1.需求 使用Vue + Element UI 实现在列表的操作栏新增一个复制按钮,复制当前行的数据可以打开新增弹窗后亦可以跳转到新增页面,本文实现为跳转到新增页面. 2.实现 1)列表页 index ...

  2. java读取照片Exif信息到实体类

    前言 1.总共读出来了228个参数信息,但是我挑选了36个我认为比较有价值的参数,弄成了实体类 (其实是因为很多参数我看不明白是啥意思) 2.为了方便,所以实体类里我直接用中文字段了 效果图 导入依赖 ...

  3. 我最喜欢的白版应用,AI加持的新功能开源!强烈推荐

    Excalidraw 把他们的文本到图表的功能开源了 Excalidraw是一个虚拟白板应用,专门用于绘制类似手绘的图表.它提供了一个无限的.基于画布的白板,具有手绘风格,支持多种功能. 之前我分享的 ...

  4. MVC控制器传值到JS

    1.传递整形数字 1 <script> 2 var data=@ViewBag.ID; 3 </script> 2.传递字符串 1 <script> 2 var d ...

  5. Microsoft Edge 分屏 推荐

    前言: 很早之前就在 Edge Dev 频道的更新公告中看到过 Edge 的新分屏功能,当时没怎么注意,昨天看文档的时候发现 Edge 的侧边栏可以拖动当作一个"虚假的"分屏页面来 ...

  6. teleport 服务端配置文件说明

    teleport 服务端配置文件说明 teleport配置文件位于/usr/local/teleport/data/etc目录下.服务器端包含两个配置文件: core.ini 和 web.ini,其中 ...

  7. 华企盾DSC邮箱服务器测试连接提示Undefined error id(端口不通)

    解决方法:由于云服务器没有开25端口,telnet不通(telnet smtp.163.com 25),允许一下25端口即可,如果不能启用25端口,则开启465或者587

  8. Android动态数字输入框

    基础view如下: 具体的思路实现: 1:展示textview实现 2: 顶层使用透明的edittext.获取焦点/删除文字等. public class BaseVerificationCodeVi ...

  9. pytest框架学习-pytest_addoption钩子函数

    适用场景:一套自动化代码,多套环境. pytest_addoption 允许用户自定义注册一个命令行参数,方便用户通过命令行参数的形式给 pytest 传递不同的参数进行不同测试场景的切换. pyte ...

  10. StringBuilder、StringBuffer

    StringBuilder 1.concat() 拼接字符串 2.indexOf() 查找 3.replace() 替换 4.subString(1,2) 截取 0,1,2 1开始 2结束 Strin ...