“Solved: Error “Access denied for user ‘root’@’localhost'” of MySql”.

Today, We are going to solve one of the most common errors of MySql.


This solution does not need to drop any tables or no need to change any user permission. just two line of code and then you will able to login into MySql console.

Without wasting much time let’s jump into it.

Fast Solution : 

Follow given steps.

Detailed Solution : 

First, you need to type below command in your terminal.

Then it will ask for the password. enter your superuser password.

After that, you will see below the screen in your terminal.

Access denied for user 'root'@'localhost' -

Then, You just need to type or you can copy this and command in your terminal and press ENTER.

After that, you need to FLUSH the PRIVILEGES.

After all this, you need to type exit again.

Now, Simply enter a command in your terminal.

It will ask for the password. Enter the password and hit ENTER and you will see successfully logged in into a console.

Access denied for user 'root'@'localhost' -

That’s It.

If you want to install a fresh installation simply go through this LINK.

Happy Coding!


Please enter your comment!
Please enter your name here