Install DBD::mysql On Panther

I spent a good deal of my evening last night installing DBD::mysql and DBI on Mac OS X 10.3.5 so I could upgrade Moveable Type to MySQL. Why bother? I wanted to see if it would improve the performance of MT and well, no it didn’t. While I was attempting to install DBD::mysql I kept receiving errors related to /blib/arch/auto/DBD/mysql/mysql.bundle. Googling the error returned what was I looking for after digging through several threads. I’d decided to put all that information in one spot for easy reference.

Installing DBD::mysql on Panther is no easy task if you try to do it without knowing about the bug in the Perl Config.pm shipped from Apple.

p. 1. Correct the bug included in Panther. (Still hasn’t been fixed since 10.3.5)

We recently discovered the DBD::mysql problem as well. The patch is to edit /System/Library/Perl/5.8.1/darwin-thread-multi-2level/Config.pm, replacing:

ld=’MACOSX_DEPLOYMENT_TARGET=10.3 cc’

with

ld=’env MACOSX_DEPLOYMENT_TARGET=10.3 cc’

p. *This step is critical*. If this isn’t corrected installing DBD::mysql will fail.

p. 2. Install DBI and DBD::mysql

The easy way is to use CSPAN from Terminal.app. If this is the first time running CSPAN there is a configuration step. Select the auto config option and all should be well. At the cspan> prompt enter in the install line.

sudo perl -MCPAN -eshell
install Bundle::DBD::mysql

A more complicated way to install the packages is manually. Download the latest versions of DBI and DBD::mysql from cspan.org.

At the time of this writing DBI-1.45.tar.gz and DBD-mysql-2.9004.tar.gz are the latest versions.

You’ll need to install DBI first.

sudo cp /Downloads/DBI-1.45.tar.gz /Library/Perl
sudo tar -zxvf DBI-1.45.tar.gz
cd DBI-1.45
sudo Perl Makefile.PL
sudo make
sudo make install

Next install DBD::mysql

sudo cp /Downloads/DBD-mysql-2.9004.tar.gz /Library/Perl
sudo tar -zxvf DBD-mysql-2.9004.tar.gz
cd DBD-mysql-2.9004
sudo Perl Makefile.PL
sudo make
sudo make install

I didn’t bother running make test on either of these installs. Feel free to do so however the DBD::mysql will most likely fail due to login errors.

Hopefully this will help somebody as I spent a good part of an evening figuring this out. Isn’t Google great? :)

No Trackbacks

3 Comments

  1. Why don’t you switch to WordPress already?

    Posted October 18, 2004 at 10:17 am | Permalink
  2. ‘Cause then I’d be copying you… we can’t have that! :) (I’ll check it out) hehe

    Posted October 18, 2004 at 10:52 am | Permalink
  3. Bas Meijer

    make test for MySQL 4.1.7

    PERL_DL_NONLAZY=1 /usr/bin/perl “-MExtUtils::Command::MM” “-e” “test_harness(0, ‘blib/lib’, ‘blib/arch’)” t/*.t
    t/00base………..ok
    t/10dsnlist……..ok
    t/20createdrop…..ok
    t/30insertfetch….ok
    t/40bindparam……ok
    t/40blobs……….ok
    t/40listfields…..Use of uninitialized value in numeric eq (==) at t/40listfields.t line 132.
    t/40listfields…..ok
    t/40nulls……….ok
    t/40numrows……..ok
    t/50chopblanks…..ok
    t/50commit………ok
    t/60leaks……….skipped
    all skipped: $ENV{SLOW_TESTS} is not set or Proc::ProcessTable not installed
    t/ak-dbd………..ok
    t/akmisc………..ok 343/351Use of uninitialized value in numeric eq (==) at t/akmisc.t line 770.
    t/akmisc………..ok
    t/dbdadmin………ok
    t/insertid………ok
    t/mysql…………FAILED tests 46-48
    Failed 3/68 tests, 95.59% okay
    t/mysql2………..ok
    Failed Test Stat Wstat Total Fail Failed List of Failed
    —-
    t/mysql.t 68 3 4.41% 46-48
    1 test skipped.
    Failed 1/18 test scripts, 94.44% okay. 3/767 subtests failed, 99.61% okay.

    Posted January 4, 2005 at 3:46 am | Permalink