Wednesday, March 11, 2020

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


I was using ubuntu 18 and simply installed MySQL (password:root) with the following commands.
  • sudo apt install mysql-server
  • sudo mysql_secure_installation
When I tried to log in with the normal ubuntu user it was throwing me this issue.
  • ERROR 1698 (28000): Access denied for user 'root'@'localhost'
But I was able to login to MySQL via the super user. Using the following commands I was able to log in via a normal user.
  • sudo mysql
  • ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
  • exit;

Then you should be able to login to Mysql with the normal account.
enter image description here

No comments:

Post a Comment

Recent Post

Databricks Delta table merge Example

here's some sample code that demonstrates a merge operation on a Delta table using PySpark:   from pyspark.sql import SparkSession # cre...