There are certain free database hosting provider which provides remote access to their database.
Remote access here signifies all the requests made to the database are
originated from their own hosting server (eg, using their hosting
service for php, jsp etc) or any other hosting service provider.
But if remote access is not allowed means all request trying to connect database will be discarded if it’s been made from other than their own servers.
So, irrespective of you correct ID and password to the database, you cannot connect to it remotely if blocked by the provider.
000webhost.com, comli.com are such providers for PHP based site
hosting, and, eatj.com is best for testing a Java hosted sites (but
for 11 days trial is only free) all above provider provides free
solved MYSQL Database connection to other website