zoukankan      html  css  js  c++  java
  • JDBC连接mysql时出现的ssl问题

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

    网上查了查,是当前版本的MySQL要求使用SSL,做出如下修改即可:

    connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/jsp_db","root","123456");

    改成

    connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/jsp_db?useSSL=false","root","123456");

    问题解决。

  • 相关阅读:
    Set,List,Map的区别
    阅读笔记15
    阅读笔记14
    阅读笔记13
    阅读笔记12
    阅读笔记11
    阅读笔记10
    架构漫谈读后感
    阅读笔记1
    暑期周记8
  • 原文地址:https://www.cnblogs.com/television/p/8529963.html
Copyright © 2011-2022 走看看