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
https://forums.phpfreaks.com/topic/152204-cant-get-mysql-to-work-with-perl/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.