解决MySQL在连接时警告:WARN: Establishing SSL connection without server's identity verificatio
起因:
程序在启动时,连接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的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- 【警告】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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- 3种Sentinel自定义异常,你用过几种?
Spring Cloud Alibaba Sentinel 是目前主流并开源的流量控制和系统保护组件,它提供了强大的限流.熔断.热点限流.授权限流和系统保护及监控等功能.使用它可以轻松的保护我们微服务 ...
- cookie和session的区别?一文讲透
一.问题 cookie和session的区别? 二.回答 1.总结如下- cookie: - cookie存储于客户端本地,即浏览器缓存 - cookie存储着sessionId,作为后台sessio ...
- WPF应用开发之附件管理
在我们之前的开发框架中,往往都是为了方便,对附件的管理都会进行一些简单的封装,目的是为了方便快速的使用,并达到统一界面的效果,本篇随笔介绍我们基于SqlSugar开发框架的WPF应用端,对于附件展示和 ...
- c++算法练习day01【2022年蓝桥杯省赛B组题目】每天做一点、、、
这个练习目前来说就比较宽松,打算在寒假(基本也就是这一个月每天刷几道题吧) 题目一: 小明决定从下周一开始努力刷题准备蓝桥杯竞赛.他计划周一至周五每天做 a 道题目,周六和周日每天做 b 道题目.请你 ...
- 【WCH以太网接口系列芯片】基于CH395的组播应用
---------------------------------------------------------------------------------------------------- ...
- SpringSecurity入门(SSM版)
1. 简介 Spring Security是一个能够为基于Spring的企业应用系统提供声明式的安全访问控制解决方案的安全框架.它提供了一组可以在Spring应用上下文中配置的Bean,充分利用了Sp ...
- All in One, 快速搭建端到端可观测体系
本文分享自华为云社区<All in One, 快速搭建端到端可观测体系>,作者:王磊. 随着云原生技术的应用,可观测成为云服务的主角,应用程序的部署密度及变化频率较传统环境有着巨大的变化, ...
- 使用容器快速在阿里云 ECS 多节点上搭建 Citus 12.1 集群
阿里云 ECS 机器节点 这里我们使用两台同一区域的 ECS 机器. 机器配置:2 核 2 G.(ps: 阿里云 99 元一年的活动) 一台安装 coordinator(协调器),这里内网 IP 为 ...
- JDK1.8下载 用阿里云盘
JDK1.8下载 用阿里云盘 jdk-8u202-windows-x64.exe https://www.aliyundrive.com/s/jJhWUk17jMt 点击链接保存,或者复制本段内容,打 ...
- ElasticSearch之系统关键配置
ElasticSearch之系统关键配置 集群名称 在配置文件$ES_HOME/config/elasticsearch.yml中指定,样例如下: cluster: name: logging-pro ...