SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Call Database on Another Web Site?

    Is it possible that I can connect to a database on another web site? Unfortunately the web site I am working on does not allow me to create a database, but I can use a database on my web site but Im not sure I can link to that. Could someone help?

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes you can, if:
    a) The server hosting the database allows connections on port 3306 through its firewall
    b) The user you connect to the database as has permission to connect from outside hosts

    If (a) and (b) are true, then you connect the same way you do locally, except you specify the IP or domain of the database server instead of "localhost" in your connection string.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So instead of "localhost" I want to put "192.168.x.x" or "192.168.x.x/localhost"? Any idea?

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Just the IP, "192.168.x.x".

    localhost is an alias for 127.0.0.1

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Unfortunately that does not work for me. Is there a way that I can test to see if port 3306 is firewalled?

  6. #6
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Start > Command Prompt

    telnet 192.168.x.x 3306

    If you get a response, then it's not firewalled.

    Whatever program/language you're using should be able to tell you if it couldn't connect and why, though?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •