Programmers learn & share
0 votes

Problem :

I am getting bellow error while I try to connect MySql database with Java using connector 8.0.11

java.sql.sqlnontransientconnectionexception: public key retrieval is not allowed

by (6.9k points)   | 186 views

1 Answer

0 votes


I also faced above error , in my case it was actually due to the wrong username and password. 

Solving the issue: 

a. Go to the line DriverManager.getConnection("jdbc:mysql://localhost:3306/?useSSL=false", "username", "password"); 

b.The fields username and password must be wrong. You must enter the username and password which you use to start your mysql client. 

Further Readings:

by (36.1k points)  
edited by
2,227 questions
2,734 answers
241 users