Perl's installed module isn't recognized

L

L. D. James

Can someone tell me what's going wrong with my perl operation? I
recently started over my Linux, Apache, Mysql, and Perl on a new hard
drive when I had a drive failure. Everything on the system is freshly
installed. At present everything works except for my scripts that
uses DBD::mysql. I used cpan to install DBD::mysql. It appears to be
installed okay, but still fail to work.

Please look at the information itemized below.

Thanks in advance for any suggestions or comments.


Simplest code to reproduce the error:

commandline: perl -MDBD::mysql -e 1
Can't load '/usr/local/lib/perl5/site_perl/5.10.0/i686-linux/auto/DBD/
mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.14: cannot
open shared object file: No such file or directory at /usr/local/lib/
perl5/5.10.0/i686-linux/DynaLoader.pm line 203.
at -e line 0
Compilation failed in require.
BEGIN failed--compilation aborted.



Attempt to install/verify module via CPAN:

cpan[1]> install DBD::mysql
CPAN: Storable loaded ok (v2.18)
Going to read /root/.cpan/Metadata
Database was generated on Fri, 14 Mar 2008 10:31:09 GMT
CPAN: YAML loaded ok (v0.65)
DBD::mysql is up to date (4.006).



Perl's Search Path:

commandline: perl -e "print qq(@INC)" | sed "s/ /\n/g"
/usr/local/lib/perl5/5.10.0/i686-linux
/usr/local/lib/perl5/5.10.0
/usr/local/lib/perl5/site_perl/5.10.0/i686-linux
/usr/local/lib/perl5/site_perl/5.10.0
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl



Location of installed mysql files from the /usr/local/lib hierarchy:

commandline: find -name mysql\*
../site_perl/5.8.8/i686-linux/Bundle/DBD/mysql.pm
../site_perl/5.8.8/i686-linux/DBD/mysql
../site_perl/5.8.8/i686-linux/DBD/mysql.pm
../site_perl/5.8.8/i686-linux/auto/DBD/mysql
../site_perl/5.8.8/i686-linux/auto/DBD/mysql/mysql.bs
../site_perl/5.8.8/i686-linux/auto/DBD/mysql/mysql.so
../site_perl/5.8.8/CGI/Session/Driver/mysql.pm
../site_perl/5.10.0/i686-linux/Bundle/DBD/mysql.pm
../site_perl/5.10.0/i686-linux/DBD/mysql
../site_perl/5.10.0/i686-linux/DBD/mysql.pm
../site_perl/5.10.0/i686-linux/auto/DBD/mysql
../site_perl/5.10.0/i686-linux/auto/DBD/mysql/mysql.bs
../site_perl/5.10.0/i686-linux/auto/DBD/mysql/mysql.so
../site_perl/5.6.1/i686-linux/Bundle/DBD/mysql.pm
../site_perl/5.6.1/i686-linux/DBD/mysql
../site_perl/5.6.1/i686-linux/DBD/mysql.pod
../site_perl/5.6.1/i686-linux/DBD/mysql.pm
../site_perl/5.6.1/i686-linux/auto/DBD/mysql
../site_perl/5.6.1/i686-linux/auto/DBD/mysql/mysql.bs
../site_perl/5.6.1/i686-linux/auto/DBD/mysql/mysql.so

-- L. James
 
S

smallpond

Can someone tell me what's going wrong with my perl operation? I
recently started over my Linux, Apache, Mysql, and Perl on a new hard
drive when I had a drive failure. Everything on the system is freshly
installed. At present everything works except for my scripts that
uses DBD::mysql. I used cpan to install DBD::mysql. It appears to be
installed okay, but still fail to work.

Please look at the information itemized below.

Thanks in advance for any suggestions or comments.

Simplest code to reproduce the error:

commandline: perl -MDBD::mysql -e 1
Can't load '/usr/local/lib/perl5/site_perl/5.10.0/i686-linux/auto/DBD/
mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.14: cannot
open shared object file: No such file or directory at /usr/local/lib/
perl5/5.10.0/i686-linux/DynaLoader.pm line 203.
at -e line 0
Compilation failed in require.
BEGIN failed--compilation aborted.

Attempt to install/verify module via CPAN:

cpan[1]> install DBD::mysql
CPAN: Storable loaded ok (v2.18)
Going to read /root/.cpan/Metadata
Database was generated on Fri, 14 Mar 2008 10:31:09 GMT
CPAN: YAML loaded ok (v0.65)
DBD::mysql is up to date (4.006).

Perl's Search Path:

commandline: perl -e "print qq(@INC)" | sed "s/ /\n/g"
/usr/local/lib/perl5/5.10.0/i686-linux
/usr/local/lib/perl5/5.10.0
/usr/local/lib/perl5/site_perl/5.10.0/i686-linux
/usr/local/lib/perl5/site_perl/5.10.0
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl

Location of installed mysql files from the /usr/local/lib hierarchy:

commandline: find -name mysql\*
./site_perl/5.8.8/i686-linux/Bundle/DBD/mysql.pm
./site_perl/5.8.8/i686-linux/DBD/mysql
./site_perl/5.8.8/i686-linux/DBD/mysql.pm
./site_perl/5.8.8/i686-linux/auto/DBD/mysql
./site_perl/5.8.8/i686-linux/auto/DBD/mysql/mysql.bs
./site_perl/5.8.8/i686-linux/auto/DBD/mysql/mysql.so
./site_perl/5.8.8/CGI/Session/Driver/mysql.pm
./site_perl/5.10.0/i686-linux/Bundle/DBD/mysql.pm
./site_perl/5.10.0/i686-linux/DBD/mysql
./site_perl/5.10.0/i686-linux/DBD/mysql.pm
./site_perl/5.10.0/i686-linux/auto/DBD/mysql
./site_perl/5.10.0/i686-linux/auto/DBD/mysql/mysql.bs
./site_perl/5.10.0/i686-linux/auto/DBD/mysql/mysql.so
./site_perl/5.6.1/i686-linux/Bundle/DBD/mysql.pm
./site_perl/5.6.1/i686-linux/DBD/mysql
./site_perl/5.6.1/i686-linux/DBD/mysql.pod
./site_perl/5.6.1/i686-linux/DBD/mysql.pm
./site_perl/5.6.1/i686-linux/auto/DBD/mysql
./site_perl/5.6.1/i686-linux/auto/DBD/mysql/mysql.bs
./site_perl/5.6.1/i686-linux/auto/DBD/mysql/mysql.so

-- L. James


Your perl is OK. It needs to interface to the mysql library
which is part of mysql.
On my system, this is loaded by the mysql-libs rpm.

rpm -qf /usr/lib/mysql/libmysqlclient.so.15
mysql-libs-5.0.45-6.fc8
--S
 
B

Ben Morrow

Quoth "L. D. James said:
commandline: perl -MDBD::mysql -e 1
Can't load '/usr/local/lib/perl5/site_perl/5.10.0/i686-linux/auto/DBD/
mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.14: cannot
open shared object file: No such file or directory at /usr/local/lib/
perl5/5.10.0/i686-linux/DynaLoader.pm line 203.

Either you don't have the MySQL client libraries installed, or your
dynamic loader doesn't know how to find them. If they aren't installed,
install them; if they are, check your /etc/ld.so.conf and make sure
you've run ldconfig.

It's a little weird that CPAN let you install DBD::mysql, since
presumably its tests didn't pass: did CPAN run the tests and somehow
they passed, or did you have to force the install? Or did you install
using your system's package manager, and it failed to install the
required libraries first? Or did you install manually, and not run the
tests?

Ben
 
L

L. D. James

Your perl is OK. It needs to interface to the mysql library
which is part of mysql.
On my system, this is loaded by the mysql-libs rpm.

rpm -qf /usr/lib/mysql/libmysqlclient.so.15
mysql-libs-5.0.45-6.fc8
--S

Thanks guys. I had pounder this problem for hours since yesterday. I
couldn't figure it out. You pointed me to the right direction. I
reinstalled an older version of mysql 4.1.22, then my scripts started
working. I installed the later version on top of the older version,
mysql 5.1.23 and it continues to work.

I see what causes the problem was, in the process of fixing a
different problem, I thought it we because of some compatibilities of
the newest mysql, so I downgraded. When that didn't fix the problem
of the other program, I removed the downgrade and upgraded again. I
guess somewhere down the line of having the older version installed,
the module had configured itself for that library.

Thank you kindly for your fast responses.

I'll experiment later with how to reconfigure the modules to use the
later version install.

When doing my file search I should have searched for libmysqlclient.so
\* rather than searching for mysql\*. This would have showed me
libmysqlclient.so.16, which may have given me the clue to reinstall
the older version. After the reinstall of the older version I have
both libmysqlclient.so.14 (which it looks for) and libmysqlclient.so.
16.

-- L. James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top