0

I have a Java application and I want to access my local database which is a MySQL database, but I have this exception:

Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

I tried to execute this command from MySQL command line client:

mysql> GRANT ALL PRIVILEGES ON mydb.* TO 'root'@'localhost' IDENTIFIED BY 'myPass';

But it didn't solve my problem and the exception still appears.

This my connection configuration "database.properties" file:

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc\:mysql\://localhost\:3306/mydb
jdbc.username=root
jdbc.password=myPass
No Idea For Name
  • 11,411
  • 10
  • 42
  • 70

0 Answers0