Saturday, December 23, 2006

DBD::mysql done

Installing the perl module DBD::mysql is notoriously plagued by glitches. Getting it going on my MacBook Pro proved no different. I found some references to others having issues, but none the same as mine. Perhaps this is because I have installed perl 5.8.8 (placing it in /usr/local/bin, archiving the existing install (5.8.6), and symbolically linking /usr/bin/perl to the new install). Or maybe it's the phase of the moon.

The error I got at the "make" stage listed two /tmp/.out files and told me they were both i386 architecture files and couldn't be bundled together. The Makefile.PL uses the output form mysql_config to set the -cflags directive by default, so I took a look at this. It was:

-I/usr/local/mysql/include -Os -arch i386 -fno-common

removing the "-arch" flag worked. All I had to do was:

mysql -u root -p
password: *****
> grant all on test.* to ''@localhost
OK
> quit

make clean
perl Makefile.PL -cflags="-I/usr/local/mysql/include -Os -fno-common"
make
make test
sudo make install

No comments: