0

I'd found too many questions related to this problem still I'm having the same problem.

I've installed MySQL Server from MYSQL::Download MYSQL Installer. Also, I've running xampp on my localhost.

http://localhost/phpmyadmin and MySQL Command Line Client are working fine and I'm able to login as well as execute SQL queries. But the problem is, if I'm using jdbc to connect to MySQL then the error comes Access denied for 'root'@'localhost' (using password:yes).
The connection string I'm using for jdbc is

DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb", "root", "root");

but it's not working. I tried removing the port number (3306), still the same problem.
I also tried to start MySQL Workbench installed with the installer and getting the same error for connection.

If anybody could help? phpmyadmin working fine and I'm able to run sql queries from a php program. But its not working fine with java.

1 Answer 1

1

Try granting the privileges:-

 mysql> GRANT ALL PRIVILEGES ON *. * TO root@localhost

-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION; 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.