User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 374,618 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,294 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 452 | Replies: 3
Reply
Join Date: Mar 2008
Posts: 1
Reputation: john777 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
john777 john777 is offline Offline
Newbie Poster

how to use same database for two domains?

  #1  
Mar 28th, 2008
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 followingi 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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Posts: 102
Reputation: mwasif is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 12
mwasif mwasif is offline Offline
Junior Poster

Re: how to use same database for two domains?

  #2  
Mar 28th, 2008
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.
Reply With Quote  
Join Date: Oct 2007
Location: South Africa
Posts: 59
Reputation: RoryGren is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
RoryGren's Avatar
RoryGren RoryGren is offline Offline
Junior Poster in Training

Re: how to use same database for two domains?

  #3  
Mar 28th, 2008
There shouldn't be a problem there. Use the same connection details for both domains.
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 1,921
Reputation: peter_budo has a spectacular aura about peter_budo has a spectacular aura about peter_budo has a spectacular aura about 
Rep Power: 9
Solved Threads: 217
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Posting Virtuoso

Re: how to use same database for two domains?

  #4  
Mar 30th, 2008
Originally Posted by RoryGren View Post
There shouldn't be a problem there. Use the same connection details for both domains.

Wrong, because DB
Originally Posted by john777 View Post
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
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 9:04 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC