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?
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/
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 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;