DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   MySQL (http://www.daniweb.com/forums/forum126.html)
-   -   how to use same database for two domains? (http://www.daniweb.com/forums/thread116155.html)

john777 Mar 28th, 2008 12:29 pm
how to use same database for two domains?
 
Dear programers,
i am new to mysql and webhosting.

i have one website script,i want to instal the same script to my two domain

names(for example: domain1.com and domain2.com)

i dont want to add this two domain like addon domain.
i have two different hosting for this two domains.

for domain1 i have instal the script,during the installation the script asked

the following:(i have filled the same below)

Host:Local host
Database name:xxx
User name:YYY
Password:ZZZ

the domain1 is working fine.

for domain2 i like to use the domain1 database(xxx)(it is in diff hosting)
1)i want to know how to use the same database for diff domains?

2)pls help me to fill the following for domain2,
Host:
Database name:
User name:
Password:

Regards,
john

mwasif Mar 28th, 2008 12:39 pm
Re: how to use same database for two domains?
 
In order to work, you need to allow the mysql username (and your host also must allow this) to connect from remote machine. In host, you need to provide the IP or the domain name e.g. domain1.com and rest of the parameters will remain same as you provided before.

RoryGren Mar 28th, 2008 2:59 pm
Re: how to use same database for two domains?
 
There shouldn't be a problem there. Use the same connection details for both domains.

peter_budo Mar 30th, 2008 6:13 am
Re: how to use same database for two domains?
 
Quote:

Originally Posted by RoryGren (Post 571500)
There shouldn't be a problem there. Use the same connection details for both domains.


Wrong, because DB
Quote:

Originally Posted by john777 (Post 571378)
for domain2 i like to use the domain1 database(xxx)(it is in diff hosting)


John, you need to ask your provider (from the one with DB) if databases is enabled for external access.
If not ask if it is posible, many providers do it, many refuse it as they do not knnow how :)
Once external access enabled your provider should also give you details how to connect to DB, can be IP or URL string


All times are GMT -4. The time now is 5:47 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC