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.

Database Sharing

Discussion in 'General Discussion' started by jackal, Apr 20, 2003.

  1. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    We have 2 servers which have different main domain names on for our support section.
    How would we link both sites to use same database?
    We would need when a post is made on either to update the other.

    Any would be appreciated.
    Thx
     
  2. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    Ok that is good. Where would we get such a script that would accomplish this?
     
  3. X-Istencedotcom

    X-Istencedotcom Well-Known Member

    Joined:
    Apr 14, 2003
    Messages:
    223
    Likes Received:
    0
    Trophy Points:
    16
    Lets say you have 2 servers.

    1. myserver.com
    2. myotherserver.com

    Then make the script on myotherserver.com connect to the MySQL server on myserver.com and have the script on myserver.com also connect to localhost, basically both scripts now write and read from the same database, meaning there is only one database to keep up to date for the script :).
     
  4. Express

    Express Active Member

    Joined:
    Apr 20, 2003
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    So would this work for what he wants?


    Server A Set % wildcard

    $servername="localhost";
    $dbusername="name_admin";
    $dbpassword="pass";
    $dbname="name_forums";

    Server B

    $servername="ipaddressofservera";
    $dbusername="name_admin";
    $dbpassword="pass";
    $dbname="name_forums";
     
  5. jackal

    jackal Well-Known Member
    PartnerNOC

    Joined:
    Feb 23, 2002
    Messages:
    708
    Likes Received:
    0
    Trophy Points:
    16
    If we did that yes it would work, but we have 15 dbs we only want to share one db. So what file would I add or change just to access that one db and not have open access to all?
     
  6. perfectsquare

    perfectsquare Active Member

    Joined:
    Sep 11, 2002
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Add a new db_user that has access to only the database you want to share.
     
Loading...

Share This Page