Connection Java - MySQL : Public Key Retrieval is not allowed
You should add client option to your mysql-connector allowPublicKeyRetrieval=true
to allow the client to automatically request the public key from the server. Note that allowPublicKeyRetrieval=True
could allow a malicious proxy to perform a MITM attack to get the plaintext password, so it is False by default and must be explicitly enabled.
https://mysql-net.github.io/MySqlConnector/connection-options/
you could also try adding useSSL=false
when you use it for testing/develop purposes
example:
jdbc:mysql://localhost:3306/db?allowPublicKeyRetrieval=true&useSSL=false
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException Public Key Retrieval is not allowed
So i deleted the total web project an created a new one and it seems to be working fine now with this url="jdbc:mysql://localhost:3306/web_student_tracker?useSSL=false"
Connection between DBeaver & MySQL
Did you try explicitly allowing public key retrieval in DBeaver?
In the connection settings, SSL tab you can find it
This is in case you are using SSL, otherwise in the same screen you can disable SSL by unchecking "use SSL" and "require SSL"
Spring Boot unable to connect to MySQL Server without prior connexion with MySQL Work Bench
I have added allowPublicKeyRetrieval=true to spring.datasource.url.
Now the Spring Boot app connects to the database also before I have done the connection using MySQL WorkBench.
Related Topics
How to Pass an Array to Constructor
How to Pass Topics Dynamically to a Kafka Listener
Java - How to Find Students With Their Highest Marks Writing a Method in a Student Class
Crudrepository How to Find by Last Date Between
Iterating Over Two Arrays Simultaneously Using for Each Loop in Java
Comparing Two List by Using Java8 Matching Methods
Resource from Src/Main/Resources Not Found After Building With Maven
How to Make Multiple Line String to Single Line String
Include Comma in a Field Value of CSV (Delimeter as Comma) in Java
Spring Data JPA and Exists Query
How to Properly Use Enums With Multiple Values
How to Enable Request Scope in Async Task Executor
Java 8 Lambda Create List of Strings from List of Objects
How to Skip the First Line of a CSV in Java
How to Fill Hashmap from Java Property File With Spring @Value
Spring @Value Annotation Always Evaluating as Null
Javax.Validation - Allow Null But Validate If the Value Is Not