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?
3 Answers
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
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.
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;