Connecting through ssh works fine on both servers:
Code SQL:
mysql -u user_name -h ip_address -p

Connecting through php only works on the server with the database:
PHP Code:
    $db=mysql_pconnect (ipuserpass) or die (mysql_error());
    
mysql_select_db(database,$db); 
Any ideas?