起因:

程序在启动时,连接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. 终端必备大杀器----Fish

    目录 下载 安装 添加 权限 依赖库安装 cmake 预处理 编译 安装 配置fish 其他 下载 Github 地址-- fish-shell openSUSE 开源下载地址 openSUSE 开源 ...

  2. 工厂模式(Factory Method)

    模式定义 定义一个用于创建对象的接口,让子类决定实例化哪一个类.Factory Method使得一个类的实例化延迟(目的:解耦)到子类. 要点总结 Factory Method模式用于隔离类对象的使用 ...

  3. js 通过id、pid遍历集合获得树结构

    原数据 let adreeJson = [ {id: 1, name: '陕西省', pid: 0}, {id: 2, name: '山西省', pid: 0}, {id: 3, name: '广东省 ...

  4. list.add()语句作用

    ----该方法用于向集合列表中添加对象 示例  本示例使用List接口的实现类ArrayList初始化一个列表对象,然后调用add方法向该列表中添加数据. public static void mai ...

  5. MINA框架

    一.小程序MINA框架分为三个部分: 有 View(视图层).App Service(逻辑层)和 Natice(系统层). 1.View(视图层) 视图层包含了小程序多个页面.每个页面都有WXML文件 ...

  6. 【布局技巧】Flex 布局下居中溢出滚动截断问题

    在页面布局中,我们经常会遇到/使用这么一类常见的布局,也就是列表内容水平居中于容器中,像是这样: <ul class="g-contaner"> <li>& ...

  7. 关于git 解决分支冲突问题(具体操作,包含截图,教你一步一步解决冲突问题)

    当在Git中有多个开发者在同一个分支上工作时,可能会发生分支冲突.分支冲突指的是多个开发者在同一时间修改相同的代码文件,导致Git无法自动合并这些更改. 比如说:我在github上进行了md文件的修改 ...

  8. 后端程序员必会的前端知识-02:JavaScript

    第二章. Javascript 它是一种脚本语言,可以用来更改页面内容,控制多媒体,制作图像.动画等等 例子 修改页面内容 js 代码位置 <script> // js 代码 </s ...

  9. ElasticSearch之cat recovery API

    命令样例如下: curl -X GET "https://localhost:9200/_cat/recovery?v=true&pretty" --cacert $ES_ ...

  10. Go 语言为什么不支持并发读写 map?

    大家好,我是 frank ,「 Golang 语言开发栈」公众号作者. 01 介绍 在 Go 语言项目开发中,我们经常会使用哈希表 map,它的时间复杂度是 O(1),Go 语言中的 map 使用开放 ...