I am trying to connect to a database using a small script but get this
error:
failed: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' perl
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
$ENV{MYSQL_UNIX_PORT} = "/var/lib/mysql/mysql.sock";
my $dsn = "DBI:mysql:database=maildb";
my $dbh = DBI->connect($dsn, "myusername", "mypasswd") or die "(cannot
connect)\n";
print "connected!!!\n";
$dbh->disconnect();
print "now disconnected!!!\n";
Am I doing something wrong?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/