Code:
CREATE USER 'user1';
SET PASSWORD FOR user1 = PASSWORD('password');
GRANT ALL ON db1.* TO 'user1'@'%';
FLUSH  PRIVILEGES;
Now, Im able to login remotely but not on localhost ! I thought % meant from anywhere including localhost ?