2

Today I've installed MySQL 5.7 on Ubuntu 18.04 after the installation it shows ERROR 1698 (28000): Access denied for user 'root'@'localhost, how to resolve this please let me know?

0

3 Answers 3

3

I had understand your problem while submitting the query. This is the very nice solution for your problem.

Please check it here:https://www.expresstechsoftwares.com/mysql-access-denied-user-root-localhost/

Cheers Ryan

2

Open your terminal and type the following commands as exactly as shown:

sudo mysql -u root -p
update mysql.user set plugin = 'mysql_native_password' where User='root';
FLUSH PRIVILEGES;

Logging in using MySQL Workbench was successful for me after this.

0

Setup Temp Environment to access MySQL

sudo systemctl stop mysqld
sudo systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"    
sudo systemctl start mysqld

Login in MySQL

mysql -u root -p

Update Password

UPDATE user SET authentication_string=password('123') WHERE user='root';

Flush Previous Privileges & Grant All

FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON mydb.* TO 'root'@'localhost' WITH GRANT OPTION;

Not the answer you're looking for? Browse other questions tagged or ask your own question.