InfiniteSilence has asked for the wisdom of the Perl Monks concerning the following question:

I'm on a Windows machine running Mysql with DBI and I get this error when trying to connect with the standard connection code:
my $dbh = DBI->connect("$driver:database=$database;host-127.0.0.1;port +=3306", "root", "mypassword")||die DBI::errrstr;
I can access Mysql, so I know it is up and running. I have checked what's on the ports using netstat -a, which reveals that Mysql is on the 3306 port. I tried changing the port Mysql was listening on as well as the one refered to in the script, but still no luck, I get the same error. Is there a way to figure out what DBI is going wrong?

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re: DBI - Can't create IP socket (10106)
by rucker (Scribe) on Aug 13, 2001 at 19:56 UTC
    Are you putting "DBI:" before the driver? Is "host-" actually "host=" ?

    Here's how I'd do it (more or less):

    my $dsn = "DBI:$driver:database=$database;host=$hostname;port=$port"; my $dbh = DBI->connect($dsn,$user,$passwd) || die DBI::errstr;
      Correction to previous post

      This doesn't have anything to do with DBI at all. Running the script on the command line reveals that it is getting the data just fine. When I call it from the webserver I get the error in the browser via the wonderful, wonderful CARP module. I am no expert in networking, but I have two other things which read ':80' as the Local Address when I look at netstat. Is it possible that something else on the machine is blocking my port access? If so, how do I kill the other listeners?

      Celebrate Intellectual Diversity

(tye)Re: DBI - Can't create IP socket (10106)
by tye (Sage) on Aug 15, 2001 at 20:15 UTC

    10106 is WSAEPROVIDERFAILEDINIT which seems a fairly low-level problem (and I can't find much specific about it -- it appears that it could be any number of problems, though). I'm assuming it is a privilege thing (the CGI doesn't have privilege to use TCP/IP) so you could try changing security settings.

            - tye (but my friends call me "Tye")
      Windows requires SYSTEMROOT environment variable to be defined to perform any socket operation. either web server or the script itself must export it. I found this myself while debugging my web server, shttpd.sourceforge.net