Can 2 wordpress installs share same database?

Discussion in 'PHP' started by whatitdo, Sep 9, 2009.

  1. #1
    I'm building a theme demo site and everytime I add a demo and a new version of wordpress to a different directory I have to recreate all post. is there a way I can make them all share the same database of posts? Can I just change each install to call the same database in the config.php file or can I copy the DB and add it to every install of wordpress?
     
    whatitdo, Sep 9, 2009 IP
    gonecrazy likes this.
  2. phprightnow

    phprightnow Peon

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yeah, you should be able to run 2 WP's on the same DB with not many problems. Just setup a master, and a slave. Slave WP install should just use the same DB info as the master's.
     
    phprightnow, Sep 9, 2009 IP
  3. whatitdo

    whatitdo Peon

    Messages:
    80
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hmm, i donyt know how to do that but i'll research it. thanks.
     
    whatitdo, Sep 9, 2009 IP
  4. phprightnow

    phprightnow Peon

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You should be able to just copy the database info over from the config.php file
     
    phprightnow, Sep 9, 2009 IP
  5. whatitdo

    whatitdo Peon

    Messages:
    80
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ya, i tried to edit the config.php file to the DB, user and password but the site quit working.
     
    whatitdo, Sep 9, 2009 IP
  6. phprightnow

    phprightnow Peon

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If your sites are hosted on different servers, then you need to set your MySQL database up to accept connections from external hosts. You can do this in cPanel with the MySQL Remote Access feature. I usually set my wildcards to %.
     
    phprightnow, Sep 9, 2009 IP
  7. whatitdo

    whatitdo Peon

    Messages:
    80
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    its on the same site. I installed another version of wp in a subfolder and I want that subfolder to use the same db as the main site
     
    whatitdo, Sep 9, 2009 IP
  8. phprightnow

    phprightnow Peon

    Messages:
    296
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    PM me FTP info, I'll do it for you real quick.
     
    phprightnow, Sep 9, 2009 IP