Mysql Warning -- Establishing SSL connection without server's identity verification is not recommended.

Warning while using lates MySQL J Driver: mysql-connector-java-5.1.41-bin.jar

Following is the warning while running the project from eclipse:

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.


Adding useSSL=false to the Database URL solves the problem.

example : "jdbc:mysql://localhost:3306/" + dbName + "? useSSL=false";

Comments

  1. "jdbc:mysql://localhost:3306/" + dbName + "?useSSL=false";
    ex: database name: shop
    I'll have "jdbc:mysql://localhost:3306/shop?useSSL=false";
    GG!

    ReplyDelete
  2. i add this
    "jdbc:mysql://localhost:3306/dbname?useSSL=false";
    but it can not work ...

    ReplyDelete
    Replies
    1. dbname refer to your database name for the system. for example database name is my_sql_database then the query will be
      - jdbc:mysql://localhost:3306/my_sql_database?useSSL=false;

      and also please note for port number your localhost using.

      Delete

Post a Comment

Popular posts from this blog

CPU locks at 700Mhz

Set navigation drawer selected item from Fragment