Two Domain One Database possible?

Discussion in 'PHP' started by nile1483, Apr 2, 2009.

  1. #1
    hello friend

    i have two site hosted on different host both support php

    in site a currently i am using one database application
    in site b (hosted on different server) i dont purchased database so i want to access database from site a,

    is it possible

    thank you
     
    nile1483, Apr 2, 2009 IP
  2. ultrasonic

    ultrasonic Peon

    Messages:
    30
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you'll have to allow remote database connections to the server site A is on.. then connect via IP instead of "localhost" from site b
     
    ultrasonic, Apr 3, 2009 IP
  3. nile1483

    nile1483 Active Member

    Messages:
    345
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Thanks for your reply

    i do the same thing but i dont get success i get flowing error

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'usernamefromsitea'@'corp4.net4india.com' (using password: YES) in /webcorp1/www/corpusers/a/s/domain.com/includes/Database.class.php on line 7


    when i try with different domain on same server its connect successfully but if i try to connect different domain and different server, its cant connect.
     
    nile1483, Apr 3, 2009 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    You have to add the user and allow access from the remote host as well.

    What method of managing your database are you using, phpmyadmin, ssh, etc...?
     
    jestep, Apr 3, 2009 IP
  5. nile1483

    nile1483 Active Member

    Messages:
    345
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #5
    I am using cpanel phpmyadmin

    how to add user and allow access from remote host

    i am using same username and password for site b as i am using for site a


     
    nile1483, Apr 3, 2009 IP
  6. nile1483

    nile1483 Active Member

    Messages:
    345
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Its working now

    i add IP with percentage in remote host and its is working now

    like 123.173.12.% instead of 123.173.12.142

    Thank you all of you for help
     
    nile1483, Apr 3, 2009 IP