Installing Perl DBD::mysql on Mac OS X 10.5
Developer — 25 Mar 2008 12:57 — 718 days ago

I just had to install DBD::mysql on my machine running Mac OS X 10.5 and found out that a few combinations don’t work:

  • Since I am on a 64 bit machine I originally installed the x86_64 MySQL packages available from mysql.com. However the system-supplied Perl is 32 bit only so that requires 32 bit MySQL client libraries. Trying to link with the 64 bit versions produced Symbol not found: _is_prefix errors.
  • I was running MySQL 5.1 RC, currently that means 5.1.23. Unfortunately, in this specific version a data structure member used by the DBD::mysql code was renamed, causing the build to fail. This renaming is going to be reverted for versions 5.1.24 and up. This problem resulted in dbdimp.c:2763: error: ‘NET’ has no member named ‘last_errno’ errors.

After installing and starting the 32 bit, 5.0.51a version of MySQL, installation worked flawlessly:

$ PATH=/usr/local/mysql/bin:$PATH sudo cpan
cpan> install DBD::mysql

...

All tests successful, 2 tests skipped.
Files=34, Tests=656,  3 wallclock secs ( 2.03 cusr +  0.53 csys =  2.56 CPU)
  /usr/bin/make test -- OK
Running make install
Installing /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Writing /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/.packlist
Appending installation info to /System/Library/Perl/5.8.8/darwin-thread-multi-2level/perllocal.pod
  /usr/bin/make install  -- OK
$ perl -MDBD::mysql -e 0

I will try MySQL 5.1 again once 5.1.24 is available.

Comments
Posted by Edmund on 26 Mar 2008 12:24

Spot on ! I had the same 64bit issues and your advice fixed it. Much obliged.

Posted by Todd on 16 Jul 2008 20:50

You are my hero. I won't tell you how long I was beating my head against this.

Powered By blojsom