|Just another Perl shrine|
Getting DBD-mysql to work with Mac OS X Lionby bmckenzie (Sexton)
|on Jan 13, 2012 at 14:13 UTC||Need Help??|
bmckenzie has asked for the
wisdom of the Perl Monks concerning the following question:
I've recently returned to the Mac (OS X Version 10.7.2, to be precise) after years of developing simple web apps and maintaining our website using Perl on Windows. Everything was going fine recreating my development environment until this:Can't load '/Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle, 1): Library not loaded: libmysqlclient.18.dylib Referenced from: /Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle Reason: image not found at /System/Library/Perl/5.12/darwin-thread-multi-2level/DynaLoader.pm line 204. at /Users/Bruce/Sites/public_html/cgi-bin/ptest.pl line 17 Compilation failed in require at /Users/Bruce/Sites/public_html/cgi-bin/ptest.pl line 17. BEGIN failed--compilation aborted at /Users/Bruce/Sites/public_html/cgi-bin/ptest.pl line 17.
A day of Googling has established that I'm not the first to see an error message like this with Mac OS X, but none of the suggested workarounds worked for me, either because they involve paths and files and things that don't seem (to me) to apply to my computer, or because I don't know what they're talking about.
The MySQL mysql-5.5.19-osx10.6-x86_64 installation appears to be OK; I see what I expect to see with phpMyAdmin.
I did have trouble installing DBD::mysql, but one of the aforementioned workarounds asserted that it was normal to have to force install. Which I did (four times, just to be sure :-). Attempts to reinstall with cpan are dismissed with a message saying everything is up to date.
I'm sure the solution will be obvious to many monks on Macs -- but please keep in mind that nothing about Unix (except its dissimilarity to Windows) is obvious to me.
Thanks so much