起因:

程序在启动时,连接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. 【教程】cpp转python Nanobind 实践 加速轻量版 pythonbind11

    主要是尝试一下把c++这边的函数封装打包给python用,选择nanobind的原因是:1. 优化速度快,2. 生成二进制包小,不过pythonbind11是更为广泛知道的,nanobind也是pyt ...

  2. httpclients 和 okhttp 区别

    HttpClient使用介绍使用HttpClient发送请求主要分为以下几步骤: 创建 CloseableHttpClient对象或CloseableHttpAsyncClient对象,前者同步,后者 ...

  3. Java并发(十八)----常见线程安全类及实例分析

    1.常见线程安全类 String Integer StringBuffer Random Vector Hashtable java.util.concurrent (JUC)包下的类 这里说它们是线 ...

  4. Cocos Creator性能调优

    一. 为什么要做性能优化 性能:是程序的一种优秀的能力.唤醒快.运行持久.稳定 这种能力正在游戏上能让你的用户感觉很爽,特征表现为加载快.运行流畅.不卡顿. 所以,性能优化的终极目标是,让你的用户体验 ...

  5. 将多个txt文件中的内容写在一个txt中的方法

    import os filename='./train_data/img_' for i in range(1,19736): newfile=filename+str(i)+'.txt' if os ...

  6. Mybatis-Flex之QueryWrapper

    1.完整DQL语句 /** * 使用QueryWrapper构建超复杂SQL语句 */ @Test public void testQueryWrapper1() { QueryWrapper wra ...

  7. Linux配置成代理服务器

    简介: 代理服务器(Proxy Server)是一种位于计算机网络中的中间服务器,它充当了客户端和目标服务器之间的中介,用于转发客户端请求并获取目标服务器的响应.代理服务器的主要功能包括以下几点: 什 ...

  8. Flask-SQLAlchemy常用新旧查询语法对比

    https://docs.sqlalchemy.org/en/20/tutorial/data.html 新旧版语法的说明 在2.x的SQLALchemy中,查询语法为: db.session.exe ...

  9. Python+Selenium4自动化之JS属性

    应用场景 在自动化中, 能对JS代码进行增.删.改的话,可以帮助我们解决很多问题, 如:修改<a>标签的target属性,让它不打开新的窗口(_blank),从而不用频繁使用switch_ ...

  10. Python 猫的 2023 年终回顾

    2023 年是 Python猫 创办的第 5 年,2024 年已经到来了,我们照例做一个简短的年终回顾吧. 1.30000 订阅与 200 原创. 2020 的年终总结时,公众号订阅数刚破 20000 ...