thendal
Programmer
- Aug 23, 2000
- 284
Hi all!
I am getting the following error in my error_log when i run the following mysql DB connect script
error_message
------------------------------------------------------
install_driver(mysql) failed: Can't load '/usr/local/lib/perl5/site_perl/5.8.0/i386-freebsd/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/i386-freebsd/DynaLoader.pm line 229.
at (eval 5) line 3
Compilation failed in require at (eval 5) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /usr/local/apache/cgi-bin/mysql_connect.pl line 6
Mysql Connect Script
-----------------------------------------------------
#!/usr/bin/perl
use DBI;
use CGI;
$op=new CGI;
print $op->header;
$dbh = DBI->connect('DBI:mysql:test', 'username', 'password')
or die "Couldn't connect to database: " . DBI->errstr;
$query=$dbh->prepare(q{select name,location from Test_table})|| die $dbh->errstr;
$query->execute()|| die $dbh->errstr;
$query->bind_columns(undef,\$name,\$location)|| die $dbh->errstr;
while(my @data=$query->fetchrow_array)
{
$name=$data[0];
print "Name : $name \n";
$location=$data[1];
print "Location: $location \n";
}
---------------------------------------
It works fine when i run the above script from command line.
I have installed Msql-Mysql-modules-1.2219 on my server.
Any help would be greatly appreciated.
-Thendal
I am getting the following error in my error_log when i run the following mysql DB connect script
error_message
------------------------------------------------------
install_driver(mysql) failed: Can't load '/usr/local/lib/perl5/site_perl/5.8.0/i386-freebsd/auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysqlclient.so.12" not found at /usr/local/lib/perl5/5.8.0/i386-freebsd/DynaLoader.pm line 229.
at (eval 5) line 3
Compilation failed in require at (eval 5) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /usr/local/apache/cgi-bin/mysql_connect.pl line 6
Mysql Connect Script
-----------------------------------------------------
#!/usr/bin/perl
use DBI;
use CGI;
$op=new CGI;
print $op->header;
$dbh = DBI->connect('DBI:mysql:test', 'username', 'password')
or die "Couldn't connect to database: " . DBI->errstr;
$query=$dbh->prepare(q{select name,location from Test_table})|| die $dbh->errstr;
$query->execute()|| die $dbh->errstr;
$query->bind_columns(undef,\$name,\$location)|| die $dbh->errstr;
while(my @data=$query->fetchrow_array)
{
$name=$data[0];
print "Name : $name \n";
$location=$data[1];
print "Location: $location \n";
}
---------------------------------------
It works fine when i run the above script from command line.
I have installed Msql-Mysql-modules-1.2219 on my server.
Any help would be greatly appreciated.
-Thendal