in reply to Re^3: Multiple file handles
in thread Multiple file handles

DBI is the plumbing; DBD::mysql is the fitting. You need both.

From the doc for DBD::mysql (plus your error handling):

my $dsn = "DBI:mysql:database=$database;host=$hostname;port=$port"; my $dbh = DBI->connect($dsn, $user, $password) or die "Couldn't connec +t to database: ".DBI->errstr;
Set up all those variables then use that exact code snippet and it should work for you.

Hope this helps!


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^5: Multiple file handles
by MoodyDreams999 (Scribe) on Apr 13, 2023 at 17:26 UTC
    Yeah, that helped alot, I was trying to find an example where they use the dsn in the connect statement, wasn't sure I was doing it right since it kept failing, probably just need to make sure its got the right credentials since we have like 5 different servers for similar things.