Remote Database Connections -
07-04-2004
, 09:10 AM
I've been administering my MySQL databases as much as possible with
Navicat, a program that's much easier to use than phpMyAdmin. However,
my biggest problems are online.
I just discovered that you can use Navicat online, using a process
called SHH tunneling - http://www.navicat.com/ssh_tunnel.php
At the same time, I'm exploring the possibility of connecting to remote
databases, since one of my webhosts is much easier to work with than the
other.
So my first question is how do you connect to a remote database?
I understand I have to go to the site with the GOOD database and grant
permission for a foreign host to access it. So I open up my C-Panel >
MySQL and scroll to the bottom, where it says Access Hosts > Localhost.
I have to type in a value where it says Host (% wildcard is allowed). I
understand I have to type in the other website's IP number, so I typed
in something similar to 67.33.165.202. But I'm supposed to register TWO
IP's if the website's IP address is different than the IP it's hosted
on. So how do I type in two IP addreesses, something like this?:
"67.33.165.202, 72.33.126.177"
Another thing I noticed is that the IP address I type in doesn't
register. When I typed in the URL - "www.mysite.org" - then clicked the
"back" link, "www.mysite.org" was displayed under Access Hosts. But it
never displays the IP address, so I can't tell if it's really registered
or not.
If and when I solve that, I have to put a query that targets a remote
database on my other site. Do either of the following queries look
correct, or do I have to add "http://" or make some other change?
@mysql_connect ("www.mysite.org" , "USERNAME" , "PASSWORD");
@mysql_select_db ("DATABASE");
$dbExternal = @mysql_connect ("www.mysite.org" , "USERNAME" , "PASSWORD");
@mysql_select_db ("DATABASE", $dbExternal);
Finally, what do you know about SSH Tunneling, especially if you've used
it withi Navicat? Is this a good solution, or is it just another steep
learning curve with questionable results? I was publishing my databases
online fairly easily with phpMyAdmin, but I hit a brick wall today and
decided it's time to look for a new program.
Thanks. |