Allowable host not working



I’ve created database with new username and password.
I can successfully connect it on dreamhost.
I want to connect to database outside the dreamhost which is running on digitalocean.
I’ve added ip address of that site to allowable hosts.
But when connecting with db, it comes error.
“Host is not allowed to connect to this MySQL server”
Please help me to fix this asap.