I have 2 websites and would like to use the same database for both sites.

The MySQL database contains just a simple guestbook. The websites are one seperate hosting accounts, but with the same host.

I'm looking to link the two sites to the database. Does anyone know if or how this is possible?

  • The websites are one seperate hosting accounts, but with the same host. I don't think so, sorry. Normally yes, you just specify the same MySQL server details.
    – ionFish
    Commented Jun 21, 2012 at 20:39

2 Answers 2


Yes it is possible.

Once you know the Host, Username and Password for your MySQL account, you can just log in to it as you normally would from as many hosts as you want.

I once did it with two different hosts. My website was on one host, and from other host I was running some cron jobs that were running queries on the other site.

Although depending on your set-up, you may need to enable external host login, because some hosts have that disabled.


I work with one client that has 20-25 websites (each website pointing to a different database) in one MySQL instance. All low-trafficked. Of course, each website has its own facing.

What you are proposing sounds like 2 websites pointing to the same database within one MySQL instance. It sounds likes it is no big deal. I would just make sure that the guest book can record from which website (URL, IP Address, etc) and through which host account the guest entry was made.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.