Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by bmckenzie (Sexton)
on Jan 22, 2012 at 20:44 UTC ( [id://949280]=note: print w/replies, xml ) Need Help??


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

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

Replies are listed 'Best First'.
Re^7: Getting DBD-mysql to work with Mac OS X Lion
by Anonymous Monk on Jan 23, 2012 at 10:43 UTC
      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

        My problem is not ...

        Hi, yes, I know this

        DYLD_LIBRARY_PATH

        If you libmysqlclient.18.dylib http://bugs.mysql.com/bug.php?id=61243 https://groups.google.com/group/pylons-discuss/browse_thread/thread/57776c1e4e20a090/933e726b1bcc407a?show_docid=933e726b1bcc407a

        http://monkeyoncode.com/2011/07/how-to-fix-library-not-loaded-libmysqlclient18dylib

Re^7: Getting DBD-mysql to work with Mac OS X Lion
by luis.roca (Deacon) on Jan 23, 2012 at 14:53 UTC

    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://949280]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found