Are you connecting to the same server that your script is on? If so, try using "localhost" as the host name. If it's an external server and if that server allows external database connections, you'll probably need a port number with the host name, e.g.:
$connx = mysql_connect('hostname.com:xxx', 'username', 'password') or die('DB connection failed: ' . mysql_error());
Change the "xxx" to whatever port number is configured for external DB connections.