Ubuntu – ERROR 1698 (28000): Access denied for user ‘root’@’localhost’ at Ubuntu 18.04

lampMySQLpermissions

I have followed this tutorial to install MySQL but after successfully installed MySQL, I could not access database.

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

Best Answer

I found a solution at here link, by following this solution I have solved my problem.

Short steps are:

sudo mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'test'; 

Note: here test is a new password for the root user. Also, remember to run the command sudo service mysql restart after altering the user.