Well if you use the ip that would allow use. However as I stated you need to allow use of the user and password via IP to the database.
See there are four types of priviledges
user % Yes ALL PRIVILEGES Yes Edit
user xx.xx.xxx.xx Yes ALL PRIVILEGES Yes Edit
usr localhost Yes ALL PRIVILEGES Yes Edit
usr somedomain.com Yes ALL PRIVILEGES Yes Edit
If you have PHPMyAdmin you should see what priviledges are on the database.