I have MySQL 5 with this defined:
CREATE DATABASE foo DEFAULT CHARACTER SET = 'utf8';
GRANT ALL ON foo.* TO foo@'%' IDENTIFIED BY 'foo';
FLUSH PRIVILEGES;
However, when accessing with user foo, pass foo, connection is refused.
When I change it to
GRANT ALL ON foo.* TO foo@localhost IDENTIFIED BY 'foo';
MySQL lets me in.
Why the first doesn’t work? AFAIK, % should match anything.
Update: found this, may be related http://forums.mysql.com/read.php?30,158830,158830
Manual references: (no answer found there)
From mysql documentation :
Check
mysql.usertable after executing your first commands