skip to Main Content

I am able to login with mysql -u root -p

but not with

mysql -u root@localhost -p

It says

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

2

Answers


  1. You need to specify the host to connect to.

    try:

    mysql -u root -h localhost -p
    
    Login or Signup to reply.
  2. Below below command:

    mysql -u root@($hostname) -p
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search