MarshallLee
MarshallLee

Reputation: 1330

MySQL 1044 (42000): Access denied for user ' '@'localhost' to database 'mysql' with Mac

I ran MySQL with the Terminal with the following command.

mysql -u root

Then I tried to execute use mysql;, but it did not go properly but showed an unexpected message as follows.

ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

Why do you think it's happening? Someone please help me..

Upvotes: 0

Views: 506

Answers (1)

Srinivas
Srinivas

Reputation: 342

Your login credentials are wrong. Did you create a password while installing MySQL?

try mysql -u root -p and enter the password in the prompt to log in.

If you've lost your password, try resetting it. View this answer to reset password.

Upvotes: 1

Related Questions