kgchis
asked on
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_6 4-suse-lin ux/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlcli ent.so when searching for -lmysqlclient
/usr/lib64/gcc/x86_64-suse -linux/4.1 .2/../../. ./../x86_6 4-suse-lin ux/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlcli ent.a when searching for -lmysqlclient
/usr/lib64/gcc/x86_64-suse -linux/4.1 .2/../../. ./../x86_6 4-suse-lin ux/bin/ld: skipping incompatible /usr/lib/libmysqlclient.so when searching for -lmysqlclient
/usr/lib64/gcc/x86_64-suse -linux/4.1 .2/../../. ./../x86_6 4-suse-lin ux/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/m ysql/" --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/bli b/arch/aut o/DBD/mysq l/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_6 4-linux-th read-multi /DynaLoade r.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_6 4-linux-th read-multi /auto/DBD/ mysql/mysq l.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.
>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
/usr/lib64/gcc/x86_64-suse
/usr/lib64/gcc/x86_64-suse
/usr/lib64/gcc/x86_64-suse
collect2: ld returned 1 exit status
So I re-ran the command with the following configuration
perl Makefile.PL --cflags="-I/usr/include/m
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/bli
# 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
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.
Doesn't SuSE have the package in a repository somewhere that you can install it from? What version of SuSE are you using?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.5 4
perl-DBD-mysql-3.0002-15.2
perl-Config-Crontab-1.11-1 2.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.1 1-0.22
perl-Data-ShowTable-3.3-58 4.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_6 4-linux-th read-multi /auto/DBD/ mysql/mysq l.so: undefined symbol: mysql_init
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
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.5
perl-DBD-mysql-3.0002-15.2
perl-Config-Crontab-1.11-1
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
perl-Date-Calc-5.4-14.5
limal-nfs-server-perl-1.1.
limal-ca-mgm-perl-1.1.74-0
yast2-perl-bindings-2.13.1
perl-Data-ShowTable-3.3-58
perl-Parse-RecDescent-1.80
perl-Bit-Vector-6.4-13.5
perl-libapparmor-2.2-0.3
perl-Bootloader-0.4.19.12-
perl-File-Tail-0.99.3-12.2
perl-XML-Writer-0.600-13.2
perl-Config-IniFiles-2.39-
The error in the log file is
/usr/bin/perl: symbol lookup error: /usr/lib/perl5/site_perl/5
ASKER
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_6 4-linux-th read-multi /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5 .8.8/x86_6 4-linux-th read-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-mul ti /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_6 4-linux-th read-multi /DBI.pm
/usr/lib/perl5/site_perl/5 .8.8/x86_6 4-linux-th read-multi /Bundle/DB I.pm
/usr/lib/perl5/vendor_perl /5.8.8/i58 6-linux-th read-multi /Bundle/DB I.pm
/usr/lib/perl5/vendor_perl /5.8.8/i58 6-linux-th read-multi /DBI.pm
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_6
BEGIN failed--compilation aborted at -e line 1.
There is a DBI.pm file find / -name DBI.pm
/usr/lib/perl5/site_perl/5
/usr/lib/perl5/site_perl/5
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/vendor_perl
ASKER
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.
perl -e 'use DBI;' returns the same error with all caps DBI.
I realize it is case sensitive.
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?
ASKER
I decided to completely reinstall the server and only use the pre-built in SUSE 10 packages.
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?
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?