How do your access a different MySql database on a different IP on a different site? <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_cityfacts = "XXX.XXX.XXX.XX" $database_cityfacts = "XXXXX_XXXX"; $username_cityfacts = "XXXX_XXX"; $password_cityfacts = "XXXXX"; $cityfacts = mysql_pconnect($hostname_cityfacts, $username_cityfacts, $password_cityfacts) or trigger_error(mysql_error(),E_USER_ERROR); ?> It isn't owkring.
You have to be able to GRANT privileges to a new user on the database. Look up the GRANT command and you'll see how to specify that the user will be accessing over a remote port.
Mostly 3306 How to set previliges ? Goto cpanel and mysql databases Then scroll down and you will add host. then add %.%.%.% it means any ip can access mysql databases.