0

im trying to connect to mysql db with java, but im getting this error, "Access denied for user 'root'@'localhost' (using password: YES)" im using mysql 5.7V i tried by changing the password, cleaning the project and more but not solved

i tried this also but didn't work

GRANT ALL PRIVILEGES ON * . * TO 'root'@'localhost'

my code:

Class.forName("com.mysql.jdbc.Driver");  
                Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/vikas","root","rass");  
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
vicky
  • 1,021
  • 2
  • 7
  • 7

0 Answers0