Access denied for user root'@'localhost

solrevdev

John Smith

Posted on September 30, 2020

Access denied for user root'@'localhost

Every time apt-get upgrade upgrades my local MySQL instance on my Ubuntu laptop I get the following error:

(1698, "Access denied for user 'root'@'localhost'")

The fix each time is the following, so here it is for me next time save me wasting time googling the error every time.

sudo mysql -u root

use mysql;

update user set plugin='mysql_native_password' where User='root';

flush privileges;

And with that all is well again!

Success? 🎉

💖 💪 🙅 🚩
solrevdev
John Smith

Posted on September 30, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related