Fresh Installation of MySql: Access denied for user ‘root’@’localhost’ (using password: YES) (MacOS)

MySQLmysql-workbench

I have just installed MySQL on MacOS and I cannot login to the database in either terminal or workbench. I'm not sure how to solve this issue.

Your connection attempt failed for user 'root' to the MySQL server at localhost:3306:
Access denied for user 'root'@'localhost' (using password: YES)

Best Answer

Just type this in the terminal:

sudo -i

You'd be taken to the root terminal and then access the databases with the command

mysql -u root

That's it now do whatever you want to do.

Related Question