Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^5: Getting DBD-mysql to work with Mac OS X Lion

by luis.roca (Deacon)
on Jan 22, 2012 at 19:11 UTC ( #949271=note: print w/replies, xml ) Need Help??

in reply to Re^4: Getting DBD-mysql to work with Mac OS X Lion
in thread Getting DBD-mysql to work with Mac OS X Lion

Sorry to hear you're still having trouble. Could you please post the code that is failing? Specifically what does your #! line look like at the top? Did you install the DBD module in the Macports /opt directory? Other than that I would say to load the library it's asking for through Macports or, even before that, do a search to see if and where the current version is on your machine.

"...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." Don Quixote

Replies are listed 'Best First'.
Re^6: Getting DBD-mysql to work with Mac OS X Lion
by bmckenzie (Sexton) on Jan 22, 2012 at 20:44 UTC
    Here's the script:
    #!/usr/bin/perl use strict; use warnings; use CGI; use CGI::Carp qw(fatalsToBrowser set_message); # set my module lib use FindBin qw($Bin); use lib "$Bin/perl_lib"; use Util::Std; use Util::Std qw/:IO/; use Date::DT_Util; use CGI::Application; use DBI; use DBD::MySQL; print "Content-type: text/html\n\n"; print "Hello, World";

    As noted, works fine if I comment out DBD::MySQL. The latter is where the CPAN installer put it: "(System) Library/Perl/5.12/darwin-thread-multi-2level/auto/DBD/". I noticed in the path, the file name is all lower case, where my script calls for "MySQL". However, changing this has no effect. I get the same error.

    I don't see any in that Library where DBD::MySQL seems to be looking for it. When I went to install DynaLoader, it failed, and the CPAN installer said I'd need to force install. "force install DynaLoader" resulted in a lot of scary questions related to changing or rebuilding the C Compiler for Perl 5.8 (I've got 5.12.3 on the computer). So I bailed out. Ugh.


        Strangely, in this instance case does not appear to matter -- I wrote that line of code "use DBD::MySQL" years ago -- and, for some reason, it has always worked -- on Windows and on Linux. The script fails in the same way if it is "DBD::mysql" or if I don't load DBD::mysql directly, but instead do DBI->connect("DBI:mysql:data . . .

        My problem is not that the module isn't found, it's that DBD::mysql doesn't know where to find (or otherwise can't load) libmysqlclient.18.dylib. I don't know either! The closest I can get with Spotlight is /opt/local/lib/mysql5/libmysqlclient.16.dylib

      Outside of the responses regarding Dynaloader and DBD::mysql, note that your shebang line is likely still calling the system Perl.
      Replace it with: #!/opt/local/bin/perl to call the version installed using MacPorts

      "...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." Don Quixote

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://949271]
[marto]: 1nickt, glad to hear it, I'm sure you'll bring improvements to their stack in due course ;)
[1nickt]: Just trying to adjust to a new culture. Better doc than I am used to , but quite a bit more Agiley meta-bullshit; at least half a dozen meetings a week, strict "sprint" schedule etc. I'll adjust. And I hope to just switch off after the "scrum" each day at
[1nickt]: ... the end of the afternoon. marto How are you, snowed in? Mum and Dad expecting snow today in Surrey. (Have 5" on the ground here in NJ. And my son's high school in SOCal closed until after Xmas due to fires.)
[Corion]: 1nickt: In a sense the meta-bullshit might even be beneficial to you as you get to hear the cow-orkers talk (or not talk) about the issues you perceive. I think Agile is mostly about the meta ;)
[Corion]: 1nickt: On Sunday maybe 10cm of snow fell, and the airport closed, and the trains stopped running etc :) It always comes as a surprise that snow falls here during the winter...
[marto]: 1nickt, no snow, just some ice on the roads and the usual idiocy associated with humans and driving in less than ideal conditions

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-12-11 11:48 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (289 votes). Check out past polls.