R
RB
I am running mySQL 3.23.57 on windows 2000. I configured it to run on named
pipes ( enable-named-pipe ), and the server starts nicely. I have a perl
script which tries to establish a connection to mySQL server:
use DBI;
my $dsn = 'dbi:mysql:mydatabase';
# set the user and password
my $user = 'root';
my $pass = 'xxxxxxxxx';
# now connect and get a database handle
my $dbh = DBI->connect($dsn, $user, $pass);
# or die "Can't connect to the DB: $DBI::errstr\n";
print "done"
When I run this from the command line, the output is a string "done".
When I run the same perl script under cgi-bin using Apache(2.0.47), I can
see the following in the error_log:
[Mon Aug 11 14:42:23 2003] [error] [client w.x.y.z] DBI
connect('mydatabase','root',...) failed: Can't connect to MySQL server on
'localhost' (10061) at E:/Program
Files/ApacheGroup/Apache2/cgi-bin/testdb.pl line 17
[Mon Aug 11 14:42:23 2003] [error] [client w.x.y.z] Can't connect to the DB:
Can't connect to MySQL server on localhost' (10061)
I can of course do this from a shell prompt:
mysql -u root -p mydatabase
mysqld-nt is not listening on port 3306 ( netstat -a shows this )....
What am I missing here? Why do I get the 10061 error ( which seems to be a
Winsock error code - connection refused ).
thanks,
rb
pipes ( enable-named-pipe ), and the server starts nicely. I have a perl
script which tries to establish a connection to mySQL server:
use DBI;
my $dsn = 'dbi:mysql:mydatabase';
# set the user and password
my $user = 'root';
my $pass = 'xxxxxxxxx';
# now connect and get a database handle
my $dbh = DBI->connect($dsn, $user, $pass);
# or die "Can't connect to the DB: $DBI::errstr\n";
print "done"
When I run this from the command line, the output is a string "done".
When I run the same perl script under cgi-bin using Apache(2.0.47), I can
see the following in the error_log:
[Mon Aug 11 14:42:23 2003] [error] [client w.x.y.z] DBI
connect('mydatabase','root',...) failed: Can't connect to MySQL server on
'localhost' (10061) at E:/Program
Files/ApacheGroup/Apache2/cgi-bin/testdb.pl line 17
[Mon Aug 11 14:42:23 2003] [error] [client w.x.y.z] Can't connect to the DB:
Can't connect to MySQL server on localhost' (10061)
I can of course do this from a shell prompt:
mysql -u root -p mydatabase
mysqld-nt is not listening on port 3306 ( netstat -a shows this )....
What am I missing here? Why do I get the 10061 error ( which seems to be a
Winsock error code - connection refused ).
thanks,
rb