troubleshooting Question

Like to use DBI to access MYSQL on WinServer 2003, but it is not working :-(

Avatar of zettler92656
zettler92656Flag for United States of America asked on
Perl
2 Comments1 Solution225 ViewsLast Modified:
Hello,

I have a Win 2003 Server, running IIS6 and Active Perl 5.8x (DBI 1.53).

Thanks to the help to this nice website, I was able to install this DBI module.

I like to access a MYSQL Database. Do I have to run anything else then "ppm install dbi"?
Is there a special driver set for MYSQL?

This is my code (of course, server, user and pwd are changed). Database runs smothly. Perl scripts are running, too.

The only thing, which is NOT working is to use DBI to access MYSQL.

Thank you for your help.
-max


#!/usr/bin/perl
#Einstellungen#
$standertverz="../";
use DBI;
  print "Content-type: text/html\n";
    print "\n";
print "test";

$dbh = DBI->connect('DBI:mysql:testdb:test-server.com', 'root','peter123') or die $DBI::errstr;
$SQL = "SELECT * FROM pet;";
my $cursor = $dbh->prepare($SQL);
$cursor->execute;
my @columns;
 while ( @columns = $cursor->fetchrow )
{
print "$columns[1] <br>";
}

$cursor->finish;
$dbh->disconnect;
print "\n";
ASKER CERTIFIED SOLUTION
clockwatcher

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros