PHP database question

Discussion in 'PHP' started by i_am_dhaval, Jul 22, 2011.

  1. #1
    if i have one website in PHP and database as well

    now that website database hosted on share server.

    now i have other system that system hosted in dedicated server.

    now i want to get data from share server hosted database from my dedicated server

    i don't want to sift the database but i want to connect that database on my dedicated server

    is this possible?
     
    i_am_dhaval, Jul 22, 2011 IP
  2. dthoai

    dthoai Member

    Messages:
    106
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    38
    #2
    Yes, it is possible to connect to your website database on shared server from dedicated server.
     
    dthoai, Jul 22, 2011 IP
  3. chandan123

    chandan123 Prominent Member

    Messages:
    11,586
    Likes Received:
    578
    Best Answers:
    0
    Trophy Points:
    360
    #3
    you need to give permission based on the ip and u can use
     
    chandan123, Jul 22, 2011 IP
  4. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #4
    This is called "balance loading mysql" Lots of huge sites do this to offload the mysql work to another server and is a very common practice.

    Very interesting read on how to set it up with a Debian server. I am pretty sure it can be done with linux server too.

    instead of localhost use the IP of the mysql server and put the port that you have open on the dedicated server for the remote connection. Make sure you setup the permission on the remote server to allow the shared servers IP address to access the MySQL database in the hosting software being used.
     
    exodus, Aug 8, 2011 IP
  5. JamesPh

    JamesPh Well-Known Member

    Messages:
    230
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    Digital Goods:
    1
    #5
    It's been explained already how to do this, but as an extra if your database server is cPanel based you can simply login to it and go to the "remote access" section and add your dedicated servers IP. This'll allow it to access the database. As said previously then enlist the database servers IP from your dedicated servers configuration.
     
    JamesPh, Aug 8, 2011 IP
  6. Andre91

    Andre91 Peon

    Messages:
    197
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    0
    #6
    OP, most solutions here are the best and easiest ways to go about the solution if cPanel or the likes are available to you which I believe it is seeing its shared hosting.

    Another way of doing this, a method I implicated some time ago, is just scrape the output from the already existing PHP script on the shared server and just output it on the dedicated server's page. Very simple and a much more dynamic approach if you ask me.
     
    Andre91, Aug 8, 2011 IP
  7. ausrixy

    ausrixy Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #7
    connect to the mysql database with the ip instead of localhost.
     
    ausrixy, Aug 10, 2011 IP
  8. sinha.sidhi

    sinha.sidhi Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I have no any idea about this......
     
    sinha.sidhi, Aug 29, 2011 IP