Jump to content

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;

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.