Can't compile DBD::msqyl

I am running SUSE Linux 10

>uname -a
Linux hostname  2.6.16.60-0.23-smp #1 SMP date x86_64 x86_64 x86_64 GNU/Linux

Mysql
mysql  Ver 14.12 Distrib 5.0.67, for pc-linux-gnu (i686) using readline 5.1


Perl
This is perl, v5.8.8 built for x86_64-linux-thread-multi

I am tring to install the perl modules for mysql.

DBI installed successfully with the command

perl -MCPAN -e 'install Bundle::DBI'

I wasn't so lucky with DBD...
The command perl -MCPAN -e 'install Bundle::DBD::mysql' failed so I am trying to compile by hand.

When I run perl Makefile.PL and then make I received the error messages:

 /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.so when searching for -lmysqlclient
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libmysqlclient.so when searching for -lmysqlclient
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status

So I re-ran the command with the following configuration

perl Makefile.PL --cflags="-I/usr/include/mysql/" --libs="-L/usr/lib/mysql/"


This eliminated the compatability errors but make test fails with the following errors:

Tried to use 'DBD::mysql'.
#     Error:  Can't load '/data/DBD-mysql-4.010/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: /data/DBD-mysql-4.010/blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: mysql_stmt_sqlstate at /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
#  at (eval 6) line 2
# Compilation failed in require at (eval 6) line 2.
# BEGIN failed--compilation aborted at (eval 6) line 2.
Bailout called.  Further testing stopped:  Unable to load DBD::mysql
make: *** [test_dynamic] Error 1


I did a make install anyway and it seemed to install without error.  However when I try to access a webpage using perl scripts that need DBD I get the following errors in the apache log files.

 /usr/bin/perl: symbol lookup error: /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so: undefined symbol: mysql_init,

So I am thinking it still is not happy with my -lmysqlclient but I am not sure how to fix it.

I have mysql-server, mysql-client, mysql-devel, and mysql-shared-compat installed.

kgchisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mjcoyneCommented:
Doesn't SuSE have the package in a repository somewhere that you can install it from?  What version of SuSE are you using?
0
mjcoyneCommented:
Oops -- I saw the version in your post.  Did you try installing  perl-DBD-mysql as an RPM (see http://www.novell.com/products/linuxpackages/server10/i386/perl-dbd-mysql.html)?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kgchisAuthor Commented:
I install the rpm packages from the SUSE 10 x86 CDs and got the same error.

Here are the results from rpm -qa |grep perl

perl-Digest-MD4-1.5-13.2
perl-XML-Parser-2.34-43.2
perl-Compress-Zlib-1.35-14.2
perl-TermReadKey-2.30-13.2
perl-X500-DN-0.28-133.2
perl-DBI-1.50-13.2
perl-5.8.8-14.7
perl-32bit-5.8.8-14.7
limal-perl-1.1.72-0.3
sax2-libsax-perl-7.1-125.54
perl-DBD-mysql-3.0002-15.2
perl-Config-Crontab-1.11-12.2
perl-Digest-SHA1-2.10-15.2
perl-TimeDate-1.16-136.2
perl-gettext-1.05-13.2
perl-PlRPC-0.2018-13.2
perl-DBD-SQLite-1.11-14.6
perl-Carp-Clan-5.3-13.5
perl-Net-Daemon-0.38-61.2
perl-URI-1.35-15.2
perl-Crypt-SmbHash-0.12-13.2
perl-Date-Calc-5.4-14.5
limal-nfs-server-perl-1.1.72-0.3
limal-ca-mgm-perl-1.1.74-0.3
yast2-perl-bindings-2.13.11-0.22
perl-Data-ShowTable-3.3-584.2
perl-Parse-RecDescent-1.80-259.2
perl-Bit-Vector-6.4-13.5
perl-libapparmor-2.2-0.3
perl-Bootloader-0.4.19.12-0.3
perl-File-Tail-0.99.3-12.2
perl-XML-Writer-0.600-13.2
perl-Config-IniFiles-2.39-13.4



The error in the log file is

 /usr/bin/perl: symbol lookup error: /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so: undefined symbol: mysql_init


0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

kgchisAuthor Commented:
OK here is an update on what I have now.

perl -v

This is perl, v5.8.8 built for x86_64-linux-thread-multi

I had no luck at all getting anywhere with MySQL compiled for x86_64.  Kept getting an error when trying to install DBD that it didn't like the libmysqlclient.so file.

So I completely uninstalled DBI and DBD.  Then I completely reinstalled MySQL 32-bit.  Then everything installed fine then with no errors.

However when I try to run  perl -e 'use dbi;' I get the following error

Can't locate dbi.pm in @INC (@INC contains: /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.


There is a DBI.pm file   find / -name DBI.pm

/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/DBI.pm
/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Bundle/DBI.pm
/usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/Bundle/DBI.pm
/usr/lib/perl5/vendor_perl/5.8.8/i586-linux-thread-multi/DBI.pm

0
kgchisAuthor Commented:
For the record before someone points this out

perl -e 'use DBI;'  returns the same error with all caps DBI.

I realize it is case sensitive.
0
Adam314Commented:
After you completly uninstalled DBI and DBD, how did you re-install them?  Did you use the package from the repository, or did you install it with CPAN?
0
kgchisAuthor Commented:
I decided to completely reinstall the server and only use the pre-built in SUSE 10 packages.
0
mjcoyneCommented:
Not too strong an objection, but isn't using the packages from the SUSE 10 repository what I suggested in my first two posts, including providing a link to the Novell site where the perl-DBD-mysql package could be found?
0
mjcoyneCommented:
Not too strong an objection, but isn't using the packages from the SUSE 10 repository what I suggested in my first two posts, including providing a link to the Novell site where the perl-DBD-mysql package could be found?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.