codeguyz — 2010-02-10T10:14:14-05:00 — #1
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?
dan_grossman — 2010-02-10T10:22:27-05:00 — #2
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.
codeguyz — 2010-02-10T10:51:24-05:00 — #3
So instead of "localhost" I want to put "192.168.x.x" or "192.168.x.x/localhost"? Any idea?
dan_grossman — 2010-02-10T11:28:58-05:00 — #4
Just the IP, "192.168.x.x".
localhost is an alias for 127.0.0.1
codeguyz — 2010-02-10T11:43:12-05:00 — #5
Unfortunately that does not work for me. Is there a way that I can test to see if port 3306 is firewalled?
dan_grossman — 2010-02-10T11:49:43-05:00 — #6
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?