T
Ted Byers
I know this arises from time to time, and yes, I have tried everything
mentioned in the MySQL reference manual
I know the server (MySQL 5.1.50) is running. All of the following
work perfectly:
mysql -h localhost --port=33066 -u MyUID -pMyPassword merchants2
mysql -h 127.0.0.1 --port=33066 -u MyUID -pMyPassword merchants2
mysql -h 192.168.2.8 --port=33066 -u MyUID -pMyPassword merchants2
All the above connect and let me run any SQL statement.
But the following scriptlet dies on the last statement with the error:
DBI connect('database=merchants2;host=localhost','rejbyers',...)
failed: Can't connect to MySQL server on 'localhost' (10061)
use strict;
use DBI;
my $db='merchants2';
my $hostname = 'localhost';
my $port = '33066';
my $user = 'MyUID';
my $dbpwd = 'MyPassword';
my $dbh = DBI->connect("DBI:mysql:database=$db;host=$hostname",
$user, $dbpwd, {RaiseError => 1});
The is especially frustrating since precisely the same perl code works
perfectly on all my other machines (that are running the same MySQL
server version and using the same perl - 64 bit Activestate Perl 5.12.
I am at a loss to know why.
Is there a way to have DBI provide more information about WHY it can't
connect?
Thanks
Ted
mentioned in the MySQL reference manual
I know the server (MySQL 5.1.50) is running. All of the following
work perfectly:
mysql -h localhost --port=33066 -u MyUID -pMyPassword merchants2
mysql -h 127.0.0.1 --port=33066 -u MyUID -pMyPassword merchants2
mysql -h 192.168.2.8 --port=33066 -u MyUID -pMyPassword merchants2
All the above connect and let me run any SQL statement.
But the following scriptlet dies on the last statement with the error:
DBI connect('database=merchants2;host=localhost','rejbyers',...)
failed: Can't connect to MySQL server on 'localhost' (10061)
use strict;
use DBI;
my $db='merchants2';
my $hostname = 'localhost';
my $port = '33066';
my $user = 'MyUID';
my $dbpwd = 'MyPassword';
my $dbh = DBI->connect("DBI:mysql:database=$db;host=$hostname",
$user, $dbpwd, {RaiseError => 1});
The is especially frustrating since precisely the same perl code works
perfectly on all my other machines (that are running the same MySQL
server version and using the same perl - 64 bit Activestate Perl 5.12.
I am at a loss to know why.
Is there a way to have DBI provide more information about WHY it can't
connect?
Thanks
Ted