Access denied for user ‘root’@’localhost’ when granting privileges

Access denied for user ‘root’@’localhost

This error always give me a headache, simply because I don’t know where to start to solve or fix this issue. This issue is not caused by not correct user authentication details because, in the first place you can login using your username and password. But when you are creating new user and granting privileges to the user, you can’t and this error shows up. Below is the instruction how to fix this:

Step one: Run the mysql_upgrade inside /installation-path/bin/. Wait until execution is finished and try to run your grant or create user script again.

Sample Output when running mysql_upgrade

Sample Output when running mysql_upgrade

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

I did not put any annoying ads which are forcing you to open other sites and install apps.

However, maintaining this site isn't a freebie. I put this up to help fellow travelers in planning their trip and expecting no return.

This time, I am asking for a small favor by subscribing to the youtube channel below which focuses on travel videos and IT-related tips.

It only takes one click and tadan... it's done! 

Also, please like this blog's Facebook page to show your support and get updates on the latest articles.