English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have several websites (say SiteOne) that have to use the same database located on www.SiteCentral.com:
On SiteOne, I write:
$link = mysql_connect("www.SiteCentral.com", "username", "password");
?>
I have set the calling site as allowed user.
I have tried all versions of the URL.
Always get "access denied".
Any idea what I am doing wrong? (or forgot to do?)

2007-07-01 06:42:38 · 4 answers · asked by just "JR" 7 in Computers & Internet Programming & Design

Can't copy the DB! The DB is updated by All sites, so when one site changes something, the change appears on all other sites.

2007-07-01 07:02:13 · update #1

4 answers

If you're using MySQL configured through Cpanel, there is a list of subnets or actual IP addresses that you can set up. If an IP is specifically mentioned in the list or belongs to one of those subnets, you will be able to access the database through that site. You'll just need to find the IP address of your remote site and add it to that list. If the IP address of your remote site is configured with DHCP (i.e. it changes periodically) you'll want to find the subnet (i.e. first 2-3 numbers in the IP address) and add the whole subnet to the list.

If the database was set up some other way, then your ISP will need to set up a firewall rule on their firewall to allow traffic to communicate from your remote server to the database server over the appropriate port (3306 by default.) Depending on the host, they may or may not be willing to do that (but probably will.)

2007-07-01 08:01:12 · answer #1 · answered by nvention 2 · 0 0

You need the mysql port (3306) open on the firewall of the server, also there may be an external firewall requiring port forwarding. You need to add a user@SiteOne and they must identify at the server end as coming from that machine. This means any client site needs to have a fixed ip address. You would be better off writing a php based web access system locally to the database, then set up user logins on it that allow access from anywhere. The opening of ports is always a risk to the system, port 80 is normally safe. Working remotely via a web interface is more secure, faster and requires only a centralised copy of the software. Modify it once and everyone gets the change immediately.

2007-07-01 13:30:51 · answer #2 · answered by Anonymous · 0 0

most ISP's, to prevent bandwidth leaching, have their SQL and MySQL databases behind a firewall.......it is only accessible from their own hosting servers....

you need to dump the db, you most likely have PHPMyAdmin which will do this......and import it into your other host.

2007-07-01 14:46:43 · answer #3 · answered by Jeffrey F 6 · 0 0

your host is blocking access to that script you will have transfer the database to the host then it shall work

2007-07-01 06:58:22 · answer #4 · answered by H P 2 · 0 0

fedest.com, questions and answers