Technext has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to install DBD-mysql-4.022 on RHEL5 2.6.18-194.el5 box. I have two versions of Perl on the given box (5.8.8 - default & 5.16.1)
Installation of DBD-mysql-4.022 failed with the following error:
# Error: Can't load '/root/.cpan/build/DBD-mysql-4.022/blib/arch/ +auto/DBD/mysql/mysql.so' for module DBD::mysql: /root/.cpan/build/DBD +-mysql-4.022/blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: mys +ql_get_server_version at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-m +ulti/DynaLoader.pm line 230.
I found that this can be fixed by specifying path to libmysqlclient.a
Ref: http://cpansearch.perl.org/src/JWIED/DBD-mysql-2.1012/INSTALL.html#known%20problemsAs we can see above, DBD-mysql is referring to the default (5.8.8) perl. I am not sure how to tell Makefile.pl to refer the latest installed perl i.e., 5.16.1. I saw that the Makefile.pl has the following entry to find the perl installation:[root@RHEL5 DBD-mysql-4.022]# perl Makefile.PL --libs='/usr/lib64/mysq +l/libmysqlclient.a' 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-s +ize=4 -m64 -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-stric +t-aliasing -DMY_PTHREAD_FASTMUTEX=1 embedded (mysql_config ) = libs (User's choice) = /usr/lib64/mysql/libmysqlclient.a 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 Unrecognized argument in LIBS ignored: '/usr/lib64/mysql/libmysqlclien +t.a' Multiple copies of Driver.xst found in: /usr/lib64/perl5/site_perl/5.8 +.8/x86_64-linux-thread-multi/auto/DBI/ /usr/lib64/perl5/vendor_perl/5 +.8.8/x86_64-linux-thread-multi/auto/DBI/ at Makefile.PL line 941 Using DBI 1.622 (for perl 5.008008 on x86_64-linux-thread-multi) insta +lled in /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/au +to/DBI/ Writing Makefile for DBD::mysql Writing MYMETA.yml and MYMETA.json
Now i know that if i prepend my latest (5.16.1) perl installation path to the variable PATH, it might work but my concern is that later if i revert the settings in PATH, then will DBD-mysql still use Perl version 5.16.1? I am asking this mainly because i don't want to disturb the existing PATH settings for applications that require Perl 5.8.8 and at the same time want to ensure that DBD-mysql always refers the latest perl i.e., 5.16.1.use Config; exec ($Config{perlpath}, $0, @ARGV )|| die $!;
Also, how can i undo what i have done by using perl Makefile.PL --libs='/usr/lib64/mysql/libmysqlclient.a' just to make sure that everything is clean?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Specify particular Perl path to a module during installation
by space_monk (Chaplain) on Nov 29, 2012 at 20:49 UTC | |
Re: Specify particular Perl path to a module during installation
by CountZero (Bishop) on Nov 29, 2012 at 20:59 UTC | |
by space_monk (Chaplain) on Nov 30, 2012 at 08:14 UTC | |
by CountZero (Bishop) on Nov 30, 2012 at 17:19 UTC | |
by Technext (Acolyte) on Dec 03, 2012 at 08:23 UTC |
Back to
Seekers of Perl Wisdom