How do you connect a website script to a database on another server??

Discussion in 'MySQL' started by stickyLink, Mar 21, 2008.

  1. #1
    I am trying to figure out if it is possible to create multiple websites with the same script and to connect all the websites to one single mysql database.

    I want to create about 20 article directories and put them all on seperate IP's but I want them all to have the same content, so i would like to connect them all to one single database.

    Does anybody have any help or suggestions?
     
    stickyLink, Mar 21, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    You use the same connection syntax except you would replace localhost with the IP or domain name of the server with the database on it. At the database you need to grant access to each user at the specific IP address.
     
    jestep, Mar 21, 2008 IP
  3. soad524

    soad524 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes this is verymuch possible, infact its realy easy!
    when you enter the mysql configuration stuff host user ect.. instead of puting localhost as the host put the host machine like if cpanel that you want the mysql databases in is on s1.example.com:2083 set the mysql host to s1.example.com Ive done this before and it works
     
    soad524, Mar 23, 2008 IP