起因:

程序在启动时,连接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. Socket.D 网络应用协议,首版发布!

    有用户说,"Socket.D 之于 Socket,尤如 Vue 之于 Js.Mvc 之于 Http" 主要特性 基于事件,每个消息都可事件路由 所谓语义,通过元信息进行语义描述 流 ...

  2. linux-ELK安装配置

    前言:   ELK 是三个开源项目的首字母缩写,这三个项目分别是:Elasticsearch.Logstash 和 Kibana.    • Elasticsearch 是一个搜索和分析引擎.     ...

  3. [ABC246Ex] 01? Queries

    Problem Statement You are given a string $S$ of length $N$ consisting of 0, 1, and ?. You are also g ...

  4. .NET周刊【12月第1期 2023-12-06】

    国内文章 .NET 与 OpenEuler 共展翅,昇腾九万里 https://www.cnblogs.com/shanyou/p/17858385.html 本文介绍了openEuler操作系统,它 ...

  5. Asp.net core Webapi 项目如何优雅地使用内存缓存

    前言 缓存是提升程序性能必不可少的方法,Asp.net core 支持多级缓存配置,主要有客户端缓存.服务器端缓存,内存缓存和分布式缓存等.其中客户端缓和服务器端缓存在使用上都有比较大的限制,而内存缓 ...

  6. Keepalived 高可用详解

    Keepalived 详解 1.Keepalived介绍 ​ Keepalived是一个基于VRRP协议来实现LVS服务高可用方案,可以利用其来避免单点故障.一个LVS服务会使用2台服务器运行Keep ...

  7. iMessage群发,iMessage群发基础知识,iMessage群发源代码分享

    在当今的数字化时代,即时通讯已经成为我们日常生活和工作中不可或缺的一部分,其中,苹果的iMessage服务因其出色的用户体验和无缝的设备间同步而备受用户喜爱. 然而,你是否想过如何利用iMessage ...

  8. CentOS 7 部署 Seafile 服务器(使用 MySQL/MariaDB)

    本文档用来说明通过预编译好的安装包来安装并运行基于 MySQL/MariaDB 的 Seafile 服务器.(MariaDB 是 MySQL 的分支) 提示:如果您是初次部署 Seafile 服务,我 ...

  9. 【OpenCV】在MacOS上使用OpenCvSharp

    前言   OpenCV是一个基于Apache2.0许可(开源)发行的跨平台计算机视觉和机器学习软件库,它具有C++,Python,Java和MATLAB接口,并支持Windows,Linux,Andr ...

  10. fstab 简介

    简介 在一般的 Unix 或者 类Unix 中,为了更好地管理磁盘资源,有时不得不挂载一个外部的磁盘,使用 mount 命令可以快速地挂载一个外部磁盘,具体用法为: # 将磁盘分区 sda2 挂载在 ...