在我们使用连接MySQL数据库时会出现这样的提示:

Tue Aug 29 13:24:29 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 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.

翻译如下:

不推荐服务器身份验证,不需要建立SSL连接。根据MySQL 5.5.45 +,+,+ 5.6.26 5.7.6要求SSL连接必须建
立明确的选项默认情况下如果不设置。符合现有的应用程序不使用SSL的verifyservercertificate属性设置
为“false”。你需要显式禁用SSL设置usessl = false,或设置usessl =真实提供服务器证书验证信任库

解决方案如下:

在URL加入useSSL=true或者false即可,如下所示:

//原先报错程序
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/scott,"root", "123456");
//更改后正确程序
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/scott?useSSL=false", "root", "123456");
//也可以使用如下
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/scott?useUnicode=true&characterEncoding=utf-8&useSSL=false", "root", "123456");

  

  

  

WARN: Establishing SSL connection的更多相关文章

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

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

    c3p0的出现,是为了大大提高应用程序和数据库之间访问效率的. 它的特性: 编码的简单易用 连接的复用 连接的管理 今天在配置C3p0的时候出现了这个warn   原因是因为要验证SSL Wed Se ...

  4. 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 ...

  5. 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 ...

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

  7. 【警告】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 ...

  8. Wed Jul 04 18:01:38 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended

    Wed Jul 04 18:01:38 CST 2018 WARN: Establishing SSL connection without server's identity verificatio ...

  9. 使用Mybatis连接到Mysql报错,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 esta

    在Eclipse中使用springboot整合Mybatis,连接到5.7版本Mysql报错WARN: Establishing SSL connection without server's ide ...

随机推荐

  1. Java中的XML

    XML是一种可扩展的标记语言,可扩展就是<>内的东西可以自己定义,可以随便写.标记语言就是加了<>符号的 .HTML是超文本标记语言,不可以拓展,因为你写个<p> ...

  2. Java动态代理之JDK实现和CGlib实现(简单易懂)

    转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6542259.html 一:代理模式(静态代理) 代理模式是常用设计模式的一种,我们在软件设计时常用的代理一般是 ...

  3. java io系列08之 File总结

    本文对File的API和常用方法进行介绍. 转载请注明出处:http://www.cnblogs.com/skywang12345/p/io_08.html File 介绍 File 是“文件”和“目 ...

  4. Linux 内核中的数据结构:基数树(radix tree)

    转自:https://www.cnblogs.com/wuchanming/p/3824990.html   基数(radix)树 Linux基数树(radix tree)是将指针与long整数键值相 ...

  5. JS常用类

    JS常用类 一.Number 1.常用数字 整数:10 小数:3.14 科学计数法:1e5 | 1e-5 正负无穷:Infinity | -Infinity 2.常用进制 二进制:0b1010 八进制 ...

  6. 905. Sort Array By Parity

    Description Given an array A of non-negative integers, return an array consisting of all the even el ...

  7. 编辑距离算法以及它的C#实现

    原文:https://www.cnblogs.com/shihuajie/p/5772173.html 注意,原文中有以下表述不当的地方 “扫描两字符串(n*m级的),如果:str1 == str2[ ...

  8. PHP 调第三方跨域接口示例

    <?php ); //错误信息 ); //php启动错误信息 ini_set('date.timezone','Asia/Shanghai'); ); //打印出所有的 错误信息 ini_set ...

  9. vue中axios 配置请求拦截功能 及请求方式如何封装

    main.js 中: import axios from '................/axios' axios.js 中: //axios.js import Vue from 'vue' i ...

  10. udp_server函数

    #include <netdb.h> #include <stdlib.h> #include <string.h> #include <unistd.h&g ...