. Advertisement .
..3..
. Advertisement .
..4..
I got the following error while running my program:
java.sql.sqlexception: access denied for user ‘root’@’localhost’ (using password: yes)
If anyone knows how to fix it, please let me know. Thanks in advance.
The cause: The error java.sql.sqlexception: access denied for user ‘root’@’localhost’ (using password: yes) indicates that you entered the incorrect root password, which is why your database connection ended in failure.
Solution: You can use this:
Use the command line or a GUI tool to carry it out. Replace %password% with the actual password. When building a database from scratch, you might use:
Follow the order of the example below:
Once you’ve logged in to MySQL, run the following instructions from the MySQL prompt:
Check now to see if the root password is stored in the table.
That can solve the problem.