Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

issues with DBD::mysql on mac

by mavili (Initiate)
on Aug 01, 2012 at 17:14 UTC ( #984839=perlquestion: print w/ replies, xml ) Need Help??
mavili has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have installed DBD::mysql driver and already have DBI installed. when I use DBD::mysql in my code, it doesn't compile. i have looked at the directory and the driver is there. what coulde be the problem? here is the output i get from running my script:
Can't load '/Users/mavili/perl5/perlbrew/perls/perl-5.14.2/lib/site_pe +rl/5.14.2/darwin-2level/auto/DBD/mysql/mysql.bundle' for module DBD:: +mysql: dlopen(/Users/mavili/perl5/perlbrew/perls/perl-5.14.2/lib/site +_perl/5.14.2/darwin-2level/auto/DBD/mysql/mysql.bundle, 1): Library n +ot loaded: libmysqlclient.18.dylib Referenced from: /Users/mavili/perl5/perlbrew/perls/perl-5.14.2/lib/ +site_perl/5.14.2/darwin-2level/auto/DBD/mysql/mysql.bundle Reason: image not found at /Users/mavili/perl5/perlbrew/perls/perl-5 +.14.2/lib/5.14.2/darwin-2level/DynaLoader.pm line 194. at tt.pl line 7 Compilation failed in require at tt.pl line 7. BEGIN failed--compilation aborted at tt.pl line 7.
EDIT: resolved by symlinking /usr/local/mysql-xxx/lib/mysql* to /usr/lib it's possibly because DBD::mysql looks in the latter directory for MySQL libraries

Comment on issues with DBD::mysql on mac
Download Code
Re: issues with DBD::mysql on mac
by coolmichael (Deacon) on Aug 01, 2012 at 17:23 UTC

    I had the same problem with MySQL, and fixed it by symlinking /usr/local/mysql/lib/libmysql* into /usr/lib.

    That might not be the best solution, but it worked for me.

      thanks! that solved my problem.
Re: issues with DBD::mysql on mac
by Anonymous Monk on Aug 01, 2012 at 21:51 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://984839]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-07-10 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (206 votes), past polls