in reply to Connect to DB on different server

Try this (directly from DBD::mysql docs on CPAN)
use strict; use warnings; use DBI; my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; my $dbh = DBI->connect($dsn, $user, $password);


- Tom

Replies are listed 'Best First'.
Re: Re: Connect to DB on different server
by goosefairy (Novice) on Sep 09, 2003 at 18:39 UTC

    Thanks, I had forgotten all about CPAN. That did the trick.

    goosefairy
      Not only are the docs on CPAN, but the DBD::mysql perldocs come with DBD::mysql when you install it. After installing DBD::mysql, just do
      perldoc DBD::mysql
      at a command prompt.

      This is true of all(?) the modules available on CPAN. HTH.