Before attempting to access that database from your script, first ensure that the database is accessible from the server at which your PHP Engine is located. Some servers have restrictions to the IP Addresses that may access the specific server for security purposes.
<?php
$connection = mysql_connect("host_name", "username", "password") or die("MySQL Error: ".mysql_error());
$database = mysql_select_db("database_name") or die("MySQL Error: ".mysql_error());
?>
Please note that if no Error message is returned, you have access to the database and the server. But if a message is returned with the error above, the error message will help you determine the cause.
Happy to help. Wish you all the best.