goosefairy has asked for the wisdom of the Perl Monks concerning the following question:
I'm embarrased to ask this question but what is the syntax for connecting to a database on a different server?
This is what I have tried:
my $dbh = DBI->connect("DBI:mysql:'dbname:hostname'","","") or die "ERROR 1: $DBI::errstr; stopped";
but I get this error -
Unknown MySQL Server Host 'hostname'
I've tried fully qualified hostname and IP as well.
When I tried 'hostname:dbname' I got Unknown MySQL Server Host 'dbname' so obviously THAT isn't right. Duh.
Any help would be very appreciated. Thanks.
goosefairy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Connect to DB on different server
by tcf22 (Priest) on Sep 09, 2003 at 18:18 UTC | |
by goosefairy (Novice) on Sep 09, 2003 at 18:39 UTC | |
by hmerrill (Friar) on Sep 09, 2003 at 20:47 UTC | |
|
Re: Connect to DB on different server
by Mr. Muskrat (Canon) on Sep 09, 2003 at 18:17 UTC |