in reply to DBI Installed DBD Failed

Of all the modules we use I found DBD::mysql the only one that was a pain to install. We are using RH7.3, perl 5.6.2 and the binary distro of mysql installed exactly as recommended. Anyway I would suggest you download DBD::mysql as the tar.gz so you can tinker with the Makefile args until make works. Hopefully the following will offer some hints even though our systems differ:

DBD-Mysql (need to spcify a raft of options on the command line) It to +ok a while to get these right as it can't find the required libs and +includes without help. [root@devel3 DBD-mysql-2.9002]# perl Makefile.PL --cflags=-I'/usr/loc +al/mysql/include/' --libs=-L'/usr/local/mysql/lib/ -lmysqlclient -lz +' --testdb=test --testuser=root --testpassword=xxxxxxxxx --testhost=l +ocalhost I will use the following settings for compiling and testing: cflags (Users choice) = -I/usr/local/mysql/include/ libs (Users choice) = -L/usr/local/mysql/lib/ -lmysqlclient + -lz nocatchstderr (default ) = 0 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb (Users choice) = test testhost (Users choice) = localhost testpassword (Users choice) = xxxxxxxxxx testuser (Users choice) = root To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'. Using DBI 1.21 installed in /usr/lib/perl5/site_perl/5.6.1/i386-linux/ +auto/DBI Writing Makefile for DBD::mysql [root@devel3 DBD-mysql-2.9002]# make gcc -c -I/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBI -I/usr/loc +al/mysql/include/ -fno-strict-aliasing -I/usr/local/include -O2 -marc +h=i386 -mcpu=i686 -DVERSION=\"2.9002\" -DXS_VERSION=\"2.9002\" -fPI +C -I/usr/lib/perl5/5.6.1/i386-linux/CORE dbdimp.c gcc -c -I/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBI -I/usr/loc +al/mysql/include/ -fno-strict-aliasing -I/usr/local/include -O2 -marc +h=i386 -mcpu=i686 -DVERSION=\"2.9002\" -DXS_VERSION=\"2.9002\" -fPI +C -I/usr/lib/perl5/5.6.1/i386-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="/usr/local/mysql/lib:/usr/lib" /usr/bin/perl myld gcc -s +hared -L/usr/local/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/ +mysql.so -L/usr/local/mysql/lib/ -lmysqlclient -lz 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::INSTALL.3pm Manifying blib/man3/DBD::mysql.3pm Manifying blib/man3/Bundle::DBD::mysql.3pm Manifying blib/man3/Mysql.3pm [root@devel3 DBD-mysql-2.9002]# make test PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl +5/5.6.1/i386-linux -I/usr/lib/perl5/5.6.1 -e 'use Test::Harness qw(&r +untests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/00base...........ok + t/10dsnlist........ok + t/20createdrop.....ok + t/30insertfetch....ok + t/40bindparam......ok + t/40blobs..........ok + t/40listfields.....ok + t/40nulls..........ok + t/40numrows........ok + t/50chopblanks.....ok + t/50commit.........ok + 14/30 skipped: No transactions t/60leaks..........skipped all skipped: no reason given t/ak-dbd...........ok + t/akmisc...........ok + t/dbdadmin.........ok 6/21New DB not in DSN list + t/dbdadmin.........ok 10/21DSN testab not in DSN list. + t/dbdadmin.........ok 14/21DSN testac not in DSN list. + t/dbdadmin.........FAILED tests 7, 11, 15 + Failed 3/21 tests, 85.71% okay t/insertid.........ok + t/mysql2...........ok + t/mysql............ok + Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/dbdadmin.t 21 3 14.29% 7 11 15 1 test and 14 subtests skipped. Failed 1/18 test scripts, 94.44% okay. 3/759 subtests failed, 99.60% o +kay. make: *** [test_dynamic] Error 11 [root@devel3 DBD-mysql-2.9002]# You will not get any compile errors or warnings if you get the libs an +d includes right. Note the 3 test ‘failures’ are not important.

cheers

tachyon

Replies are listed 'Best First'.
Re: Re: DBI Installed DBD Failed
by biosysadmin (Deacon) on Apr 01, 2004 at 16:03 UTC
    One little-known fact about RedHat is that they sometimes bundle CPAN modules as RPMs. They usually bundle popular modules that are difficult to compile, such as DBD::MySQL. They also provide source RPMs, so that you can tweak your makefile settings if you like (although I don't know how well these build, I've never tried them myself).

    There's definitely a lot more RPM-packaged modules out there. This method of installing modules has its ups and downs, but it's very quick in a pinch. For another cool CPAN/RPM interoperability tool, check out cpan2rpm. It's a tool to build RPMs of CPAN modules.

    :D