It's pretty easy: have a look at the
mysql_connect function. The 1st parameter you have to enter is the name of the server the MySQL server is running on. So if you want to connect to a remote server, simply enter the domain where the MySQL is running on:
There might be a chance that this won't work as there's an option in the MySQL server configuration that, if set to true, only allow connections via localhost to it's server. In that case, you'll have to write a php script that runs on the remmote server, and that will grab the data from the MySQL server. Instead of connecting to the remote MySQL server, you'll have to fetch the output of the php page