Jump to content

Can't get MySQL to work with Perl


Recommended Posts

I've been struggling with this for a while now. I can't seem to get MySQL to work with Perl on my Windows box. I get an Internal 500 error, and my log says:

 

[Thu Apr 02 04:06:10 2009] [error] [client 192.168.0.30] Premature end of script headers: test.pl
[Thu Apr 02 04:06:10 2009] [error] [client 192.168.0.30] Can't locate Mysql.pm in @INC (@INC contains: C:/WEB/PERL/site/lib C:/WEB/PERL/lib .) at C:/WEB/public_html/test.pl line 3.\r
[Thu Apr 02 04:06:10 2009] [error] [client 192.168.0.30] BEGIN failed--compilation aborted at C:/WEB/public_html/test.pl line 3.\r

 

Configuration:

Windows XP SP2

Apache 2.0.63

ActiveState Perl 5.8.8 Build 822

DBD-Mysql 4.005

 

At first I couldn't even find the DBD-Mysql file, but I finally found a repository that had it and installed it with PPM. It says version 4.005 is installed, and it can verify it.

 

dbd-mysql.jpg

 

My Perl script:

 

#!C:\WEB\PERL\bin\perl.exe

use Mysql;

print "Content-type: text/html\n\n";

$host   = 'localhost';
$user   = 'root';
$pass   = 'root';
$dbname = 'test';

$db = Mysql->connect($host,$dbname,$user,$pass);

if ($db) {
print "works...";
}

 

So, what am I doing wrong?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.