Error 1698 (28000): Access denied for user ‘root’@’localhost’

I installed the MySQL database in Linux and set all the passwords by executing the “sudo mysql_secure_installation”. But when I am able to try to log in with SQL Workbench then got the following error:

Error 1698 (28000): Access denied for user 'root'@'localhost'

Solution:

  1. Login first with MySQL Command shell.
sudo mysql -u root -p

2. Change the password as strong:

ALTER USER 'root'@'localhost' Identified by 'new-password';

3. Execute the flush privileges:

FLUSH PRIVILEGES;

4. Then try to open SQL Workbench with the new password, it’s working for me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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