Getting Perl DBD::mysql working on OS X 10.7?

Solution 1:

After quite a bit of frustration, I eventually found a simple solution that works.

The salient details are that you need to update the DYLD_LIBRARY_PATH to include /usr/local/mysql/lib. The easiest way of doing that is to add the following to your ~/.bashrc file:

export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"

I went into a little more detail in a blog post here: http://www.bartbusschots.ie/blog/?p=2186

Solution 2:

I had the same symptoms, but a different problem: perl, by default, runs as 64bit executable, but my mysql installation and hence all its libraries are 32bit only. Forcing perl to run in 32bit mode solved it:

defaults write com.apple.versioner.perl Prefer-32-Bit -bool yes