3

I am new to Java. I created Java Maven project and am getting the below error while connecting to MySQL. I am posting my code below.

In pom.xml,

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.11</version>
</dependency>

In class,

 private void connection() {
     try {
            Class.forName("com.mysql.cj.jdbc.Driver").newInstance();
            connect = DriverManager.getConnection("jdbc:mysql://10.100.00.00:3305/dbname" , 
                                    "username","password");     
     }
     catch(SQLException ex) {       
         System.out.println(ex.getMessage());

     }
     catch(Exception ex) {      
         System.out.println(ex.getMessage());
     }
 }

It was throwing java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required from SQLException.

halfer
  • 19,824
  • 17
  • 99
  • 186
Anjali
  • 1,680
  • 4
  • 26
  • 48

1 Answers1

0

As a result of the java mysql connector driver being incompartible with the installed version of MYSQL DB.

Kindly check answer posted by @P Satish Patro on this post: Spring boot CLIENT_PLUGIN_AUTH is required

Winter MC
  • 355
  • 2
  • 7