I went through a lot initially trying to get perl to be able to interface to mysql and postgres on Mac OSX. My steps weren't optimal, and I wouldn't recommend them for anyone.
However, after purchasing my Mac Book Pro, I had to go through the process again, but this time, it was much more refined. So in essence, it boils down to this:
- Make sure you have your flavor of mysql or postgresql installed AND PAY ATTENTION TO WHETHER IT SHOULD BE A 32 BIT BUILD OR A 64 BIT BUILD. If you are on a modern mac, chances are you're going to be using a 64 bit build of either of these.
- wget the latest DBD::Pg or DBD::mysql driver from CPAN. You're going to have to manually build these with the libs and flags your mysql was built with. The easiest way to obtain these flags via mysql_config --cflags and --libs (respective config for pg too). Then, run perl Makfile.PL with --cflags and --libs set with the appropriate settings
- Make sure mysql/pg are actually running! Your tests will fail otherwise.
This is brief, hurried, and probably not nearly as comprehensive as others. But, it should give you a relatively intuitive overview of how to get it going on your shiny mac.
Please let me know if I've left anything out!