Reputation: 2781
What is the difference between *
, %
, Any
in the username/host fields when granting permissions to a user, and how would the combination of them differ?
For example:
GRANT ALL PRIVILEGES ON db.* TO '*'@'Any';
would this be the same as
GRANT ALL PRIVILEGES ON db.* TO 'Any'@'%';
EDIT: The Any
field I was thinking of comes from phpMyAdmin. Perhaps it means something different? I have pasted a screenshot below to illustrate what I mean.
Upvotes: 0
Views: 124
Reputation: 111249
The word "any" has no special meaning.
MySQL does not support wildcards in the user name, so the first example is illegal. To grant privileges to an anonymous user from a host called any
use:
GRANT ALL PRIVILEGES ON db.* TO ''@'Any';
The second example is legal, but it grants privileges to a user called "any" who may connect from any host.
Upvotes: 1