LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-22-2011, 09:41 AM   #1
smc2
LQ Newbie
 
Registered: Apr 2010
Posts: 29

Rep: Reputation: 0
Can't Install DBD:mysql


May you please some one tel me why I cant install DBD::mysql?

I reinstall perl and DBI several times

Please guide me.
Perl V5.12 / OS:REDHat Enterprise 5.5
Thnaks

Code:
[root@testsrv5 sh]# cd DBD-mysql-4.018
[root@testsrv5 DBD-mysql-4.018]# ls
ChangeLog    dbdimp.h      lib                   MANIFEST       myld      t
constants.h  eg            Makefile.PL           MANIFEST.SKIP  mysql.xs  TODO
dbdimp.c     INSTALL.html  Makefile.PL.embedded  META.yml       README
[root@testsrv5 DBD-mysql-4.018]# perl Makefile.PL


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'root' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing
  embedded      (mysql_config) =
  libs          (mysql_config) = -L/usr/lib64 -lmysqlclient -lpthread -lm -lrt -ldl
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) =
  testpassword  (default     ) =
  testsocket    (default     ) =
  testuser      (guessed     ) = root

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lmysqlclient
Using DBI 1.615 (for perl 5.012002 on x86_64-linux-thread-multi) installed in /opt/ActivePerl-5.12/lib/auto/DBI/
Writing Makefile for DBD::mysql
[root@testsrv5 DBD-mysql-4.018]# make
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
gcc -c  -I/opt/ActivePerl-5.12/lib/auto/DBI -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_REENTRANT -D_GNU_SOURCE -DUSE_SITECUSTOMIZE -fno-merge-constants -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"4.018\" -DXS_VERSION=\"4.018\" -fPIC "-I/opt/ActivePerl-5.12/lib/CORE"   dbdimp.c
/opt/ActivePerl-5.12/bin/perl-static -p -e "s/~DRIVER~/mysql/g" /opt/ActivePerl-5.12/lib/auto/DBI/Driver.xst > mysql.xsi
/opt/ActivePerl-5.12/bin/perl-static /opt/ActivePerl-5.12/lib/ExtUtils/xsubpp  -typemap /opt/ActivePerl-5.12/lib/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 650
gcc -c  -I/opt/ActivePerl-5.12/lib/auto/DBI -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_REENTRANT -D_GNU_SOURCE -DUSE_SITECUSTOMIZE -fno-merge-constants -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"4.018\" -DXS_VERSION=\"4.018\" -fPIC "-I/opt/ActivePerl-5.12/lib/CORE"   mysql.c
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/lib64" /opt/ActivePerl-5.12/bin/perl-static myld gcc  -shared -O2 dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so     \
           -L/usr/lib64 -lpthread -lm -lrt -ldl         \

chmod 755 blib/arch/auto/DBD/mysql/mysql.so
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Manifying blib/man3/DBD::mysql.3
Manifying blib/man3/DBD::mysql::INSTALL.3
Manifying blib/man3/Bundle::DBD::mysql.3
[root@testsrv5 DBD-mysql-4.018]# vi tt
You have new mail in /var/spool/mail/root
[root@testsrv5 DBD-mysql-4.018]# make test
PERL_DL_NONLAZY=1 /opt/ActivePerl-5.12/bin/perl-static "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base.t .................. 1/6
#   Failed test 'use DBD::mysql;'
#   at t/00base.t line 21.
#     Tried to use 'DBD::mysql'.
#     Error:  Can't load '/root/sh/DBD-mysql-4.018/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: /root/sh/DBD-mysql-4.018/blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: mysql_get_server_version at /opt/ActivePerl-5.12/lib/DynaLoader.pm line 201.
#  at (eval 9) line 2
# Compilation failed in require at (eval 9) line 2.
# BEGIN failed--compilation aborted at (eval 9) line 2.
Bailout called.  Further testing stopped:  Unable to load DBD::mysql
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 255
[root@testsrv5 DBD-mysql-4.018]#

Last edited by smc2; 01-22-2011 at 09:47 AM.
 
Old 01-22-2011, 10:15 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,901

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
Quote:
Note (probably harmless): No library found for -lmysqlclient
You miss the mysql-devel package for your distro. Install the package first and then run "make clean" and try again to build DBD:mysql
 
Old 01-24-2011, 09:02 AM   #3
smc2
LQ Newbie
 
Registered: Apr 2010
Posts: 29

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
You miss the mysql-devel package for your distro. Install the package first and then run "make clean" and try again to build DBD:mysql
Dear Bathory,
But I've installed mysql's related packages previously.
MySQL-client-5.5.8-1.rhel5.x86_64.rpm
MySQL-devel-5.5.8-1.rhel5.x86_64.rpm
MySQL-embedded-5.5.8-1.rhel5.x86_64.rpm
MySQL-server-5.5.8-1.rhel5.x86_64.rpm

here is output of command rpm -aq | grep -i mysql:

Code:
[root@testsrv5 sh]# rpm -qa | grep -i  mysql
perl-DBD-MySQL-3.0007-2.el5
MySQL-python-1.2.1-1
libdbi-dbd-mysql-0.8.1a-1.2.2
MySQL-devel-5.5.8-1.rhel5
MySQL-server-5.5.8-1.rhel5
mysql-connector-odbc-3.51.26r1127-1.el5
MySQL-client-5.5.8-1.rhel5
I deleted them and re-install them again repeatedly but the error remains..

Thanks.

Last edited by smc2; 01-24-2011 at 09:03 AM.
 
Old 01-24-2011, 01:32 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,901

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
Quote:
/opt/ActivePerl-5.12/bin/perl-static -p -e "s/~DRIVER~/mysql/g" /opt/ActivePerl-5.12/lib/auto/DBI/Driver.xst > mysql.xsi
/opt/ActivePerl-5.12/bin/perl-static /opt/ActivePerl-5.12/lib/ExtUtils/xsubpp -typemap /opt/ActivePerl-5.12/lib/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Looks like you're running Active perl. I guess that's the reason you cannot install the module. You may uninstall Active perl and install perl and the needed modules (like perl-DBD-MySQ) using yum.
Mind that if you want to stay with Active Perl, there are modules for it you can install to do your job.

Regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't install DBD::mysql Tom Marshal Linux - Software 5 12-22-2014 11:40 AM
Bugzilla - MySQL - perl - DBD::mysql install problem amchargue Linux - Software 3 09-10-2008 01:01 AM
Bugzilla - MySQL - perl - DBD::mysql install problem Runningonair Linux - Software 8 10-12-2007 01:42 AM
DBD::MySQL + MySQL install problems. Elleroth Linux - Software 4 03-24-2006 07:53 AM
Can't install DBD::mysql or DBD::Pg DogTags Mandriva 2 01-21-2004 08:13 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration