Disclaimer: I don’t know Perl, I’m just using it to run a local process in an application.

I had to upgrade my perl libraries after upgrading to Snow Leopard, which installs Perl 5.10. More specifically, the perl process didn’t connect to the MySQL database anymore.

Searching on the net, I found suggestions that if you have installed mysql in 32 bits, the DBD::mysql library won’t work. And it didn’t. Using this article I uninstalled mysql. And than using the instructions from this other article, I installed mysql in 64 bits.

On my iMac, the installation of mysql Perl library went smoothly, using these instructions (from our Perl guru):

1. To start the cpan shell:

sudo perl -MCPAN -e shell

2. In this shell, I ran:

install Bundle::CPAN
install DBI
install DBD::mysql

On the MacBook, just because I messed around with CPAN settings or something, the DBI failed to install.

To solve this problem, I had to erase the following folders:

1. “.cpan” folder from my user’s root folder

2. the following two folders used by Perl 5.10: “/Library/Perl/5.10.0/” and “/Library/Perl/Updates/5.10.0″ (most probably the second one is not a must).

After erasing these, I started again the CPAN shell and run the three commands from above. Voila! All working well.

UPDATE: After installing the 64 bit version of the mysql Perl library, and upgrading the MySQL local installation to 64 bit also, I had trouble running the mysql ruby gem which was compiled in 32 bits. After trying different options, I’ve come to the conclusion that installing Snow Leopard from scratch is the best option, so I did a clean install of everything and now all runs smootly!


One Comment

  1. Actually Hivelogic got it wrong about installing the mysql gem.

    The correct command to install it under SL is:

    sudo env ARCHFLAGS=”-arch x86_64″ gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config –with-mysql=/usr/local/mysql –no-rdoc –no-ri


Post a Comment

*
*