Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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/ line 194. at line 7 Compilation failed in require at line 7. BEGIN failed--compilation aborted at 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
Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2016-05-30 23:46 GMT
Find Nodes?
    Voting Booth?