December 03, 2003

Building MySQL on Panther

This is just a helpful note so maybe someone won’t go through the same dumb frustration. Fink builds and installs MySQL 4.0.15 with no problems on Panther, and when you do a:

# sudo fink install mysql

It also installs 'mysql-client' and 'mysql-shlibs' for you. After trying to install DBD::mysql for a few minutes I got nothing but a whole bunch of errors and realized that fink hadn't installed the include files. Why wouldn't '-client' include those when it includes 'libmysqlclient' and such? Got me, but I only realized this when I did a basic sanity check ensuring that fink did everything it was supposed to:

shazam:~/.cpan/build/DBD-mysql-2.9003 root# fink list | grep mysql
        dbd-mysql-pm    2.1026-2        Placeholder for versioned DBD::mysql packages
        dbd-mysql-pm560 2.1026-2        Perl5 Database Interface to MySQL
 i      mysql   4.0.15-21       Open Source SQL database
 i      mysql-client    4.0.15-21       Open Source SQL database - Client
        mysql12-dev     4.0.15-21       Open Source SQL database - Development headers and libraries
 i      mysql12-shlibs  4.0.15-21       Open Source SQL database - Shared libraries

Hey, what's that 'mysql12-dev' without an 'i' next to it? Gah, gotta install that separately:

# sudo fink install mysql12-dev

This also installs the script /sw/bin/mysql_config which is used by DBD::mysql (and presumably other client apps) to find out where libraries and include files are located. Once that was in and I followed this advice about changing the Perl ld configuration then everything compiled ok, sweet.

The funny thing is that I never even use MySQL, sticking with Postgres for OpenInteract development. But I'm going to be working with some folks next week (more soon) who have both their internal and external applications using MySQL 4.x, and I need to be able to replicate their environment.

Next: Query objects vs. SQL
Previous: 'Right tool for the job' is stupid