ERROR 1698 (28000): Access denied for user ‘root’@’localhost’ on fresh MySQL installation

Problem: You get a “ERROR 1698 (28000): Access denied for user ‘root’@’localhost’” error message when logging in as root on a fresg MySQL installation. You are running the mysql command without sudo.         Run the mysql command with sudo i.e sudo mysql -uroot -p