Can i use one mysql data in two domain

Discussion in 'MySQL' started by mixtaka, Jun 17, 2010.

  1. #1
    Can i use Same wordpress mysql database for two different domain. if yes how.
     
    mixtaka, Jun 17, 2010 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Yes, you can. Simply provide the same MySQL username and password to the 2nd wordpress instance.
     
    mwasif, Jun 17, 2010 IP
  3. graspit

    graspit Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes you can but use different table prefixes.
     
    graspit, Jun 20, 2010 IP
  4. amrox

    amrox Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yes, mysql isn't limited to domains, its limited to whatever you access rights you provide. Ie. username, password, host (ip address), you can specify this using "GRANT ACCESS....", eg: "GRANT ALL ON <database_name>.* TO <USERNAME>@'<IP_ADDRESS>' IDENTIFIED BY '<PASSWORD>';"
     
    amrox, Jun 20, 2010 IP
  5. mixtaka

    mixtaka Active Member

    Messages:
    267
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #5
    can anyone tell me step by step process, im using wordpress. and both domain is hosted by two different godaddy account.
     
    mixtaka, Jun 21, 2010 IP
  6. phpmatt

    phpmatt Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Are you looking to replicate the site on both domains?

    Can't you just connect via the IP address rather than localhost from the 2nd server?
     
    phpmatt, Jun 22, 2010 IP
  7. mixtaka

    mixtaka Active Member

    Messages:
    267
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #7
    Thanx for your all message, but still did not get the clear answer.

    I want to run two domain (wordpress) site on one mysql server, so if i add, edit any post from one domain, than second will automatically updated
     
    mixtaka, Jun 22, 2010 IP
  8. cerno

    cerno Well-Known Member

    Messages:
    207
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    108
    #8
    There are a few steps to accomplish the task
    1. Go into each of your godaddy accounts and point the domains at the same IP address where you will host both websites (the domains can be in different accounts but the websites need to be hosted on the same server alongside each other so they can access the same database)
    2. Create the first website and database1
    3. If you want a different theme and graphics then copy the folder and rename website2, replace graphics you want, leave setup file pointing at database1

    If you have root access create the virtual server entry manually to point each domain to the proper folder. If you don't have root access then in the automated system create your second website so you get a folder created - but don't run the setup process at the website, you just need the folder name.
    Then go in via ftp and change the name of your clone folder to what the host is expecting and change the automated folder to something else.

    You should end up with two folders for two websites, both pointing at the same database, but be able to theme differently if you rename files in the second website. You will have to tweak your theme to not take website name from database, but rather hard coded in the theme.

    I am a Drupal user not Wordpress but I think they operate similarly, I hope this helps you
     
    cerno, Jun 22, 2010 IP
  9. jar117

    jar117 Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    If you use Cpanel, log in to your account where you have your database created (database server). Under "Databases" click the "RemoteMySQL" and then add the ip address of the other site (ip of the server that the other site is hosted). And for the setting of database on the other site, you need to use the ip address of your database server instead of "localhost".
     
    jar117, Jul 1, 2010 IP
  10. milan202

    milan202 Peon

    Messages:
    104
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    yes...you can...go to database connect file and give same user name and password...the condition must be both domain must be on same server....
     
    milan202, Jul 1, 2010 IP
  11. ashu_sood08

    ashu_sood08 Peon

    Messages:
    125
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    you can use the same user name and password but do not use the same data that the user can review on the two sites it is spam
     
    ashu_sood08, Jul 2, 2010 IP