Search code examples
mysqlaccess-denied

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


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?


Solution

  • It means your password is wrong or the account "root" has no access to the database on host "localhost".

    Look at the right side bar. There are multiple questions equivalent to yours.