MYSQL error: 1045 (28000): Access denied for user 'root'@'localhost'

Viewed 21007

When I try to connect to the sql server and enter the following in command prompt:

shell> mysql --user=username--password=password db_name

I get error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y ES)

What does this error mean?

3 Answers

On Windows -

  1. Search for services
  2. Stop the service named MySQL[#] (in my case it was MySQL80).
  3. Start the service again.
  4. Open Command Prompt and type:

    mysql [database name] -u [user name] -p

It worked for me when no other solutions worked. Hope this solves your issue as well.

Related