Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by luis.roca (Deacon)
on Jan 22, 2012 at 19:11 UTC ( [id://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 DynaLoader.pm 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.

    Bruce

        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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://949271]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found