1

I installed MySQL to my Mac (with MAMP installer) and have a problem. When I create a user with "@%" hostname this way:

CREATE USER 'test'@'%' IDENTIFIED BY 'test';

and I try to connect via CLI: mysql -u test -ptest, I get this error:

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

But when I change hostname to localhost:

RENAME USER 'test'@'%' TO 'test'@'localhost';

it works.

Any idea how to make MySQL use the wildcard?

Thanks.

Taryn
  • 242,637
  • 56
  • 362
  • 405
JakubM
  • 2,685
  • 2
  • 23
  • 33
  • 2
    Possible duplicate of http://stackoverflow.com/questions/10299148/mysql-error-1045-28000-access-denied-for-user-billlocalhost-using-passw/. Please see my answer here: http://stackoverflow.com/questions/10299148/mysql-error-1045-28000-access-denied-for-user-billlocalhost-using-passw/11216911#11216911 – RandomSeed Nov 07 '12 at 14:01

1 Answers1

0

As YaK suggests, it is because of anonymous user ''@'localhost' created by MySQL installation. Problem was solved after removal of this user. Thanks a lot YaK!

JakubM
  • 2,685
  • 2
  • 23
  • 33