ibm1620 has asked for the wisdom of the Perl Monks concerning the following question:

After installing perlbrew and perl 5.16.3 into my home directory on a CentOS 6 system, I used cpanm to try and install DBD::mysql.

It failed thusly:

Checking dependencies from MYMETA.json ... Checking if you have Data::Dumper 0 ... Yes (2.135_06) Checking if you have Test::Simple 0.90 ... Yes (1.001014) Checking if you have Test::Deep 0 ... Yes (1.120) Checking if you have DBI 1.08 ... Yes (1.634) Building and testing DBD-mysql-4.033 cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm cp README.pod blib/lib/DBD/README.pod cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm cc -c -I/mxhome/charrison/perl5/perlbrew/perls/perl-5.16.3/lib/site_p +erl/5.16.3/x86_64-linux/auto/DBI -I/usr/local/mysql/include -m64 -f +PIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing +-DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-strict-aliasing -pipe -fstack- +protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT +S=64 -O2 -DVERSION=\"4.033\" -DXS_VERSION=\"4.033\" -fPIC "-I/mxhom +e/charrison/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/x86_64-linux/ +CORE" dbdimp.c /mxhome/charrison/perl5/perlbrew/perls/perl-5.16.3/bin/perl -p -e "s/~ +DRIVER~/mysql/g" /mxhome/charrison/perl5/perlbrew/perls/perl-5.16.3/l +ib/site_perl/5.16.3/x86_64-linux/auto/DBI/Driver.xst > mysql.xsi /mxhome/charrison/perl5/perlbrew/perls/perl-5.16.3/bin/perl /mxhome/ch +arrison/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/ExtUtils/xsubpp +-typemap /mxhome/charrison/perl5/perlbrew/perls/perl-5.16.3/lib/5.16. +3/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c Warning: duplicate function definition 'do' detected in mysql.xs, line + 242 Warning: duplicate function definition 'rows' detected in mysql.xs, li +ne 754 cc -c -I/mxhome/charrison/perl5/perlbrew/perls/perl-5.16.3/lib/site_p +erl/5.16.3/x86_64-linux/auto/DBI -I/usr/local/mysql/include -m64 -f +PIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing +-DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-strict-aliasing -pipe -fstack- +protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT +S=64 -O2 -DVERSION=\"4.033\" -DXS_VERSION=\"4.033\" -fPIC "-I/mxhom +e/charrison/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/x86_64-linux/ +CORE" mysql.c Running Mkbootstrap for DBD::mysql () chmod 644 mysql.bs rm -f blib/arch/auto/DBD/mysql/mysql.so LD_RUN_PATH="/lib/../lib64" /mxhome/charrison/perl5/perlbrew/perls/per +l-5.16.3/bin/perl myld cc -shared -O2 -L/usr/local/lib -fstack-prote +ctor dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so \ -L/usr/local/mysql/lib/mysql -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::README.3 Manifying blib/man3/DBD::mysql::INSTALL.3 Manifying blib/man3/Bundle::DBD::mysql.3 PERL_DL_NONLAZY=1 /mxhome/charrison/perl5/perlbrew/perls/perl-5.16.3/b +in/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', ' +blib/arch')" t/*.t # Failed test 'use DBD::mysql;' # at t/00base.t line 15. Bailout called. Further testing stopped: Unable to load DBD::mysql # Tried to use 'DBD::mysql'. # Error: Can't load '/mxhome/charrison/.cpanm/work/1460642897.942 +6/DBD-mysql-4.033/blib/arch/auto/DBD/mysql/mysql.so' for module DBD:: +mysql: /mxhome/charrison/.cpanm/work/1460642897.9426/DBD-mysql-4.033/ +blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: mysql_get_server +_version at /mxhome/charrison/perl5/perlbrew/perls/perl-5.16.3/lib/5. +16.3/x86_64-linux/DynaLoader.pm line 190. # at t/00base.t line 15. # Compilation failed in require at t/00base.t line 15. # BEGIN failed--compilation aborted at t/00base.t line 15. FAILED--Further testing stopped: Unable to load DBD::mysql make: *** [test_dynamic] Error 255 -> FAIL Installing DBD::mysql failed. See /mxhome/charrison/.cpanm/wor +k/1460642897.9426/build.log for details. Retry with --force to force +install it. 1 distribution installed
Sorry, that's a mess to read.

I tried previously to install with --force, but then got segfaults using DBD::mysql. Can anybody help?

Thanks..

UPDATE The file /mxhome/charrison/.cpanm/work/1460642897.9426/DBD-mysql-4.033/blib/arch/auto/DBD/mysql/mysql.so does exist.

Replies are listed 'Best First'.
Re: Trouble installing DBD::mysql
by stevieb (Canon) on Apr 14, 2016 at 14:52 UTC

    Per the documentation:

    "Please note that this will only work if the prerequisites are fulfilled, which means you have a C-compiler installed, and you have the development headers and mysql client libraries available on your system."

    Do you have these prereqs installed?

      C compiler is in /usr/bin/, development headers are in /usr/include/, mysql client libraries are in /usr/local/mysql/.
Re: Trouble installing DBD::mysql
by Anonymous Monk on Apr 14, 2016 at 16:02 UTC
      $ ldd -v /mxhome/charrison/.cpanm/work/1460642897.9426/DBD-mysql-4.03 +3/blib/arch/auto/DBD/mysql/mysql.so linux-vdso.so.1 => (0x00007fffef3a0000) libpthread.so.0 => /lib/../lib64/libpthread.so.0 (0x00007f81bb +399000) libm.so.6 => /lib/../lib64/libm.so.6 (0x00007f81bb114000) librt.so.1 => /lib/../lib64/librt.so.1 (0x00007f81baf0c000) libdl.so.2 => /lib/../lib64/libdl.so.2 (0x00007f81bad08000) libc.so.6 => /lib/../lib64/libc.so.6 (0x00007f81ba973000) /lib64/ld-linux-x86-64.so.2 (0x0000003576400000) Version information: /mxhome/charrison/.cpanm/work/1460642897.9426/DBD-mysql-4.033/ +blib/arch/auto/DBD/mysql/mysql.so: libpthread.so.0 (GLIBC_2.2.5) => /lib/../lib64/libpthr +ead.so.0 libc.so.6 (GLIBC_2.4) => /lib/../lib64/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib/../lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/../lib64/libc.so.6 /lib/../lib64/libpthread.so.0: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x8 +6-64.so.2 ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux- +x86-64.so.2 ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linu +x-x86-64.so.2 libc.so.6 (GLIBC_2.3.2) => /lib/../lib64/libc.so.6 libc.so.6 (GLIBC_PRIVATE) => /lib/../lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/../lib64/libc.so.6 /lib/../lib64/libm.so.6: libc.so.6 (GLIBC_PRIVATE) => /lib/../lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/../lib64/libc.so.6 /lib/../lib64/librt.so.1: libpthread.so.0 (GLIBC_2.2.5) => /lib/../lib64/libpthr +ead.so.0 libpthread.so.0 (GLIBC_PRIVATE) => /lib/../lib64/libpt +hread.so.0 libc.so.6 (GLIBC_2.3.2) => /lib/../lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/../lib64/libc.so.6 libc.so.6 (GLIBC_PRIVATE) => /lib/../lib64/libc.so.6 /lib/../lib64/libdl.so.2: ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linu +x-x86-64.so.2 libc.so.6 (GLIBC_PRIVATE) => /lib/../lib64/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/../lib64/libc.so.6 /lib/../lib64/libc.so.6: ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linu +x-x86-64.so.2 ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x8 +6-64.so.2
        It turns out that Operations recently juggled around some directories in order to better manage having mySQL 5.1, mariadb, percona, and oracle versions of these libraries! Based on the timing of those changes, I'd guess my problem is related to them, and is entirely local to my environment. Probably not a whole lot the perlmonks can do in the way of pinning down the exact problem.

        Thanks for your time.