ok, i just setup a new server (redhat 7.3) and my guy says that the
dbd/dbi stuff is configured for perl-to-mysql connectivity, but i get
the following error message in my error log each time i try to run a
script from either the command line or via the browser:
---------------
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC
contains: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1
/usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.6.1/i386-linux
/usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at (eval
3) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: ExampleP, Pg, Proxy.
at /home/domaincentric/mcp/www/menu.cgi line 13
---------------
perhaps my script is the problem? here's some sample code:
---------------
$cgi = new CGI;
$DSN = "DBI:mysql:database=mcp";
$dbh = DBI->connect($DSN, "theusername",
"thepassword") or die "Unable to connect to the Control Panel
database(s)";
$mysql_query= qq{SELECT ITEM_ID, ITEM_NAME, SECURITY_LEVEL FROM
menuitems WHERE ACTIVE='Y' AND CATEGORY='$CATEGORY' ORDER BY ITEM_NAME
ASC};
$sth = $dbh->prepare("$mysql_query");
$sth->execute();
while($ref = $sth->fetchrow_hashref())
{
$ITEM_ID = $ref->{'ITEM_ID'};
$ITEM_NAME = $ref->{'ITEM_NAME'};
...
}
$sth->finish();
--------------------
if anyone has suggestions, please advise. thanks!
jim