1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to connect to a remote database?

Discussion in 'MySQL' started by I. Brian, Apr 18, 2006.

  1. #1
    I'm looking to import content from one of my vbulletins to another -I could simply download the SQL file from the source, upload to the new server, etc.

    However, I wondered whether it would be possible to connect directly to the database from a remote location, as this would be much easier - if so, what sort of replacement am I looking to use instead of "localhost"?

    Many thanks for any replies.
     
    I. Brian, Apr 18, 2006 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Yeah you can... you would need to make sure the database server is configured to allow access from the outside world though. Instead of using localhost, you would just use the actual IP address (or name) of the server. For example the db server for this forum is mysql.digitalpoint.com (different physical computer than the ones running the web servers, although on the same local subnet).
     
    digitalpoint, Apr 18, 2006 IP
  3. I. Brian

    I. Brian Business consultant

    Messages:
    810
    Likes Received:
    59
    Best Answers:
    1
    Trophy Points:
    145
    #3
    Thanks for the reply - much appreciated. I'll get this chased up with the host to make sure that I'm fine to do it, and also what the correct hostname is.
     
    I. Brian, Apr 18, 2006 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    The hostname is probably as simple as the IP address of the website using it normally. If nothing else, you might try that IP with your username and password and see if the security is already is setup for outside access.
     
    digitalpoint, Apr 18, 2006 IP
  5. kashem

    kashem Banned

    Messages:
    1,250
    Likes Received:
    76
    Best Answers:
    0
    Trophy Points:
    0
    #5

    How can I make the database that runs in my office server accessible to over internet?
     
    kashem, Apr 23, 2006 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    digitalpoint, Apr 23, 2006 IP
  7. dfsweb

    dfsweb Active Member

    Messages:
    1,587
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    88
    #7
    Yeah, do what Shawn's suggested. This should work as long as you can connect remotely to the database. You can also use something like "SQLYog" to access and manage your database. It's free and I find that it's interface is much better to use as it's windows based (compared to MySQL Admin).

    However, if your host blocks all remote blocks all remote access like one of my previous hosts did and if they refuse to allow remote access, you can use "Putty". You can easily download this from the net (free again) and just enter your database login details and it connects directly to the database. Technically speaking, it creates a secure SSH tunnel between your computer and your host. Once you do this, you can then use SQLYog or whatever else you want to use to access the database.

    Check with your host before using Putty though, although I highly doubt that they will have a problem with you accessing the database this way. In fact, my own host had recommended this method to me. Hope this helps!
    dfsweb

    P.S: It's been a while since I used Putty to connect this way but I think that once you create the SSH tunnel you should just be able to connect using "localhost" instead of an IP address as you will effectively be connecting "locally" with the help of the SSH tunnel.
     
    dfsweb, Apr 23, 2006 IP
  8. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #8
    if you have phpmyadmin installed, you can also go in there and edit where any individual user can access the database from as well. could be a lot easier, depending on your preferences.
     
    disgust, Apr 23, 2006 IP
  9. dfsweb

    dfsweb Active Member

    Messages:
    1,587
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    88
    #9
    dfsweb, Apr 23, 2006 IP
  10. tonyrocks

    tonyrocks Active Member

    Messages:
    1,574
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    88
    #10
    Sometimes you will run into performance issues when connecting to DB remotely. I would remotely connect for now, then start copying data over...parallel...and cut off the remote when you have migrated everything over.
     
    tonyrocks, Apr 23, 2006 IP
  11. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #11
    or you could always connect remotely and use some sort of caching system :)

    then again, if you connect remotely to do something that's done rarely-- for example, adding data, or on the admin side-- the loss in performance generally isn't a huge deal.
     
    disgust, Apr 23, 2006 IP
  12. nICEsHARE

    nICEsHARE Active Member

    Messages:
    280
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
  13. gopkris2000

    gopkris2000 Peon

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Is there any option to configure database remote privileges in phpmyadmin ?
     
    gopkris2000, Mar 8, 2010 IP
  14. killaklown

    killaklown Well-Known Member

    Messages:
    2,666
    Likes Received:
    87
    Best Answers:
    0
    Trophy Points:
    165
    #14
    isnt that backwords of what your really should do? In the best case, the database and application/logic should be on separate servers... Application Server | Database Server
     
    killaklown, Mar 9, 2010 IP