The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL: How to share one database from multiple websites?

Discussion in 'General Discussion' started by SuperBaby, Apr 26, 2007.

  1. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    I intend to install vBulletin forum script in 3 websites (different hosting account on the SAME server). The script will be installed on each website so that they will have their own design theme. But all 3 scripts will share the same MySQL database.

    domain1.com <--- MySQL database hosted here and named "username_forum".

    domain2.com <--- The vBulletin forum script will use the MySQL database hosted on domain1.com

    domain3.com <--- The vBulletin forum script will use the MySQL database hosted on domain1.com

    How do I do it?

    I believe I have to create a host under:
    cPanel >> MySQL Database >> Account Maintenance (Add Host)
    But I do not know what to specify here.

    Also, for the script in domain1.com, the config for connection should be "localhost". What about the config for domain2.com and domain3.com? What should be used to replace "localhost"?
     
  2. nickp666

    nickp666 Well-Known Member

    Joined:
    Jan 28, 2005
    Messages:
    770
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    /dev/null
    just set the database name/username/password for the database on domain1 in the configs for all of the other domains, although you may run into issues with table locking - thats down to the scripts and probably cant be prevented
     
Loading...

Share This Page