Hi All,

I have installed MySql database on a RedHat 8.0 Database, I am trying to access the 
records in a table using the perl script, which is as below:

#! /usr/bin/perl

use DBI;

my $dsn = 'DBI:mysql:engineer:localhost';
my $db_user_name = 'engineer';
my $db_password = 'xport';
my $dbh = DBI->connect($dsn, $db_user_name, $db_password);

my $sth = $dbh->prepare(qq{ select empid, empname from employee });
$sth->execute();
while (my ($id, $name) =
    $sth->fetchrow_array())  # keep fetching until
                             # there's nothing left
{
     print "$id, $name\n";
}
$sth->finish();


It fails saying:

perl: relocation error: 
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBD/mysql/mysql.so: 
undefined symbol: mysql_init

I have installed DBD-mysql-2.1025 rpm on the machine and I executed these commands

perl Makefile.PL --cflags=-I'/mysql/include' --libs=-L'/mysql/lib' --testdb=mydb 
--testuser=myuser --testpassword=mypwd --testhost=localhost --testport=3306

make

make test  (all the tests failed)

make install

Please tell me whether there's any problem with DBD driver installation, if so tell me 
how to install it properly. And also tell me, if any additional drivers are required 
and from where I can get those drivers.

Thanks and regards,
Umesh

Reply via email to