Jump to content

[SOLVED] php - mysql question on cross server support


sillysillysilly

Recommended Posts

I would like to run a script on one server to access the mysql database on another server (both I own).  For example I want to run a script on my laptop that will read data from the mysql database on my home computer running apache 2.2  I am using dyndns to ensure I am always able to get to the computer.  I have gone to the www.mypage.org and can run the scripts on that site (my computer)  but the scripts on that computer are set for localhost as the domain.  When I set the config up on my computer I use

define("DB_SERVER", "localhost");

define("DB_USER", "fakeusername");

define("DB_PASS", "fakepassword");

define("DB_NAME", "fakedatabase");

 

When I set up the laptop I use:

 

define("DB_SERVER", "mypage.org");

define("DB_USER", "fakeusername");

define("DB_PASS", "fakepassword");

define("DB_NAME", "fakedatabase");

 

Is there something different I need to do in the PHP, the Mysql or the apachie?

Link to comment
Share on other sites

I tried that but still get the same error.

 

Until you post the error, no one can help you with what the problem is. xxxxxx out any sensitive information in the error message, but you have got to provide the relative information you know about the problem. There are at least a dozen different things that could prevent a remote connection from working.

Link to comment
Share on other sites

Hi,

There error code indicates that the network connection has been refused. You should check that there is a MySQL server running, that it has network connections enabled, and that the network port you specified is the one configured on the server.  Also check the firewall.

 

Thanks

Stu

Link to comment
Share on other sites

I think I am getting closer; I found some info that tells me I have to config mysql to allow tcp/ip  I tried it but it caused scripts that were running before to crash; I think however this is because I have those looking to localhost since they are on the local host.  I might try hardcoding those systems to the server name and see how that goes.

Link to comment
Share on other sites

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.