PHP - Connect database remotely using IP address -


how can connect remote database using ip address? have code evetime load site error not connect mysql: can't connect mysql server on 'xxx.xx.xxx.xx:80'

define ('db_user', 'user'); define ('db_password', 'password'); define ('db_host', 'xxx.xx.xxx.xx:80'); define ('db_name', 'databasename');  $dbc=mysql_connect(db_host, db_user, db_password)      or die ('could not connect mysql: '.mysql_error()); @mysql_select_db (db_name)      or die ('could not select database" '.mysql_error());; 

try using port 3306 instead:

define ('db_host', 'xxx.xx.xxx.xx:3306'); 

port 3306 default mysql port, whereas port 80 http.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -