« VOB UUIDs | Main | Clearcase License Graphs »

Building DBD::MySQL

  • Built DBD::MySQL for Solaris
  • Having problems building DBD::MySQL for Linux

How to build DBD::MySQL

After downloading DBD::mysql from http://search.cpan.org/~capttofu/DBD-mysql-4.003/lib/DBD/mysql.pm I encountered some problems. First one needs to use the appropriate perl, one that has a compatible DBI module already. I found this in /app/cmpackages/perl/bin/perl. The more standard perl, /apps/perl/5.8.3/bin/perl seems to have a newer DBI module that is not compatible with the DBD::mysql that I downloaded.

Then one needs to give the proper parameters to generate the Makefile:

$ export PATH=$PATH:/apps/mysql/4.0.16/bin
$ /apps/cmpackages/perl/bin/perl Makefile.PL \
>    --libs="-L/apps/mysql/4.0.16/lib/mysql -lmysqlclient -lz" \
>    --cflags=-I/apps/mysql/4.0.16/include/mysql \
>    --testhost=mysql01.dal.design.ti.com \   These will not always be the same
>    --testuser=ccprojects \                  This will change
>    --testpassword=ccpr0jects                This will change (note the 0 not O)

Note that we explicitly use /apps/cmpackages/perl/bin/perl here. I would rather use /apps/perl/5.8.3/bin/perl but it's DBI appears to be too new for this version of DBD::mysql (!).

This will produce a Makefile which you then do:

$ make
$ make test

Alas, normally one would do a make install but that would attempt to install into /usr/local/perl, not something we wish to do. And there doesn't appear to be a way to pack into Makefile.PL where you want to eventually install this module when make install is run, so we need to actually modify the Makefile itself.

Turns out that perl Makefile.PL <options> specifies which perl to use thus the following appears in the generated Makefile:

INSTALLPRIVLIB = /apps/cmpackages/perl/lib/5.8.0
INSTALLSITELIB = /apps/cmpackages/perl/lib/site_perl/5.8.0
INSTALLVENDORLIB = 
INSTALLARCHLIB = /apps/cmpackages/perl/lib/5.8.0/sun4-solaris-thread-multi
INSTALLSITEARCH = /apps/cmpackages/perl/lib/site_perl/5.8.0/sun4-solaris-thread-multi
INSTALLVENDORARCH = 
INSTALLBIN = /apps/cmpackages/perl/bin
INSTALLSITEBIN = /apps/cmpackages/perl/bin
INSTALLVENDORBIN = 
INSTALLSCRIPT = /apps/cmpackages/perl/bin

Thus this means a make install will install the module into whichever Perl installation we specified in the perl Makefile.PL <options>! Alas we cannot write to those areas yet...

TrackBack

TrackBack URL for this entry:
http://defaria.com/mt/mt-tb.cgi/10