Installing DBD::Mysql
What a pain. Even CPAN couldn’t help. I love using CPAN for installing perl modules. It is usually a seemless operation. But DBD::Mysql on Mac OS X just wouldn’t go for me. I am installing in the usual location for a standard install - /usr/local
What I eventually had to do was this to get it to install:
sudo perl Makefile.PL –cflags=”-I/usr/local/mysql/include -Os -arch ppc -fno-common” –libs=”-L/usr/local/mysql/lib -lmysqlclient -lz -lm”
After that the make and sudo make install worked fine. I have a G4 thus the -arch ppc. If you have and intel mac, change that to -arch i386.
If you run it without putting the –cflags and –libs you will notice the paths are /usr/local/mysql/include/mysql and /usr/local/mysql/lib/mysql.
For some reason the default install has an extra directory mysql on the end of each path. I hope this helps if some of you are banging your heads to get DBD::Mysql to install.