Reputation: 8756
I tried something like below on localhost to grant access from any host:
grant all on tos_db.* to 'tos'@'%' identified by 'tos';
However, when I tried the following command on localhost, it didn't work:
$ mysql -u tos -p
Enter password:
ERROR 1045 (28000): Access denied for user 'tos'@'localhost' (using password: YES)
Then I replaced the %
symbol with localhost
in the grant statement. Unsurprisingly, it worked. But I am confused. Isn't the %
symbol supposed to match any host? Or is it just for remote host?
Upvotes: 0
Views: 54
Reputation:
You get that error because the wildcard %
does not cover socket communications which thing the localhost is for.
Upvotes: 1