Jump to content

connecting the remote database server!


rameshfaj

Recommended Posts

How can i connect to the remote database server using PHP code,assuming that the remote server has default Mysql configuration.I have done like this:

 

<?php

mysql_connect("IP:PORT","username","password");

//where the paramters are only format not real values

?>

 

The error is like this:

 

Couldnot connect to the database....

Link to comment
https://forums.phpfreaks.com/topic/86605-connecting-the-remote-database-server/
Share on other sites

It simply won't work with the default mysql configuration. You need to allow your username to connect from a specified remote ip address/domain name, or if you really like living on the edge you can enable a connection from any ip/domain.

 

mysql> GRANT ALL PRIVILEGES ON *.* TO 'yourname'@'your.ip.goes.here' IDENTIFIED BY 'yourpass' WITH GRANT OPTION;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.