I tried to grant user for database at database.com from a domain but it failed. Only the domain's IP works. (example.com is having IP 1.1.1.1)
For example:
GRANT super ON *.* TO 'user'@'1.1.1.1' IDENTIFIED BY 'password';
The above works fine. I can access the database remotely.
GRANT super ON *.* TO 'user'@'example.com' IDENTIFIED BY 'password';
This failed!
When I try to use PHP script to connect from example.com to database.com, it says:
mysql_connect('database.com', 'user', 'password');
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'user'@'1.1.1.1' (using password: YES)
Any idea why giving privilege to user base on domain 'user'@'example.com' doesn't work?