View Full Version : Perl DBI Connect problem

08-05-2005, 07:56 AM
I'm having a problem connecting to my MySQL DB using the DBI module.

Here's the perl code:
# Build Connection string
my $dsn = "DBI:mysql:test:localhost:3306";
my $dbUser = 'testuser';
my $dbPass = 'testpass';

my $dbh = DBI->connect ($dsn, $dbUser, $dbPass, { RaiseError => 1, PrintError => 1});

and the error that kicks back:
DBI connect('test:localhost:3306','testuser',...) failed: Can't connect to MySQL server on 'localhost' (111) at ./players.pl line 12

I can do the following from a shell:
mysql test -u testuser -p

and using the password above get in fine...any ideas?

EDIT: Nevermind - I reinstalled the phpMySQL 1.1 from the site manager and it's working now...