Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: dyld: lazy symbol binding failed (was MAC OS 10.6 upgrade breaks DBD:mysql)

by GrandFather (Sage)
on Mar 04, 2010 at 02:54 UTC ( #826591=note: print w/replies, xml ) Need Help??

in reply to dyld: lazy symbol binding failed (was MAC OS 10.6 upgrade breaks DBD:mysql)

I just had the same 'dyld: lazy symbol binding failed: ...' issue. The key seems to be that the word width of the mysql install must match the running Perl's word width. That can be a bit subtle because the default Mac SnowLeopard Perl build seems to be 'fat' and what happens at run time depends on the word width the OS is using.

The 'solution' is, if it doesn't work install mysql with the other word width. The catch is that you then need to reinstall DBD::mysql and that means you first have to uninstall it. The easiest way to do that seems to be:

sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD sudo rm -rf /Library/Perl/5.10.0/darwin-thread-multi-2level/DBD

although if you have other DBD modules installed that may be a bit nasty!

True laziness is hard work
  • Comment on Re: dyld: lazy symbol binding failed (was MAC OS 10.6 upgrade breaks DBD:mysql)
  • Download Code

Replies are listed 'Best First'.
Re^2: dyld: lazy symbol binding failed (was MAC OS 10.6 upgrade breaks DBD:mysql)
by graff (Chancellor) on Jun 21, 2010 at 02:07 UTC
    Gramps! If you were in the U.S. right now, I'd wish you a happy Father's Day, since that is applicable at the moment here. (But I gather Australia's on the other side of the Date-line, and maybe doesn't even have this concept of one day for making fathers feel like they can get special attention.)

    Anyway, I have run into the exact problem described in one of the posts above: macosx 10.6 (snow leopard, replacing a previous 10.5 on my macbook), Perl 5.10.0 (x86_64, as per the macosx distro), newly installed mysql 5.1.48 64-bit (replacing a 5.0.1 32-bit version that had been working fine with osx 10.5): DBI/DBD::mysql newly installed (the latter by hand, to get the tests to pass), and now a simple one-liner like this:

    perl -MDBI -le '$d=DBI->connect("DBI:mysql:database=test;host=localhos +t","test",""); print "ok"'
    Works fine when run as root, but fails (with the thread-topic error message) when run as me.

    Your explanation sounded like something I might be able get my head around, but alas, I don't know what you're talking about. Where/how do I control or learn about this "word width" issue?

    Actually, it turns out this anonymonk reply above had the right answer: a typical root shell in this sort of setup does not have "VERSIONER_PERL_PREFER_32_BIT=yes" when perl runs, whereas my own personal login account does. Of course, I don't have anything like this showing up in my normal shell environment -- it only shows up when I run perl, and if I change $ENV{VERSIONER_PERL_PREFER_32_BIT} to "no" inside a perl script, it's already too late to take effect (DBD::mysql still fails).

    Luckily, if I this to my .bashrc file, perl pays attention, and DBD::mysql works (finally!!!)

    So, to recap my voyage through this morass...
    1. upgraded from macosx 10.5 to 10.6, causing upgrade from perl 5.8.8 +to 5.10.0, and therefore... 2. had to "mysqldump --database each_db_needed | gzip > each_db_needed +.dump.gz (update) 2b. Shut down running mysqld 3. had to install mysql 5.1.48 64-bit (macosc binary distro) 4. change "/usr/local/mysql" symlink target from mysql-5.0.1 to mysql- +5.1.48 (update) 4b. Start mysqld 5. gunzip < each_db_needed.dump.gz | mysql 6. set up mysql accounts and passwords 7. install DBI (standard cpan style) 8. install DBD::mysql (by hand -- for some reason, 'testuser' needed t +weaking) 9. add 'export VERSIONER_PERL_PREFER_32_BIT=no' to my .bashrc 10. hope that step 9 doesn't break lots of other stuff...
    This thread has proven to me once again how valuable perlmonks is. I'm moved to donate more money.
      This old problem is new to me since I just installed os x 10.6 and upgraded to 10.6.8. My system c2d hence 64 bit, the perl is 5.10.0 from apple, 64bit too, and I installed mysql 5.1.63 for mac 10.6 64bit from a downloaded dmg. But these didn't save me from errors:
      dyld: lazy symbol binding failed: Symbol not found: _mysql_init Referenced from: /Library/Perl/5.10.0/darwin-thread-multi-2level/aut +o/DBD/mysql/mysql.bundle Expected in: flat namespace dyld: Symbol not found: _mysql_init Referenced from: /Library/Perl/5.10.0/darwin-thread-multi-2level/aut +o/DBD/mysql/mysql.bundle Expected in: flat namespace ========================
      So what's the easiest fix? Thanks a lot
        Did you do "step 9" (add export VERSIONER_PERL_PREFER_32_BIT=no to your .bashrc)?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://826591]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-03-19 02:03 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (231 votes). Check out past polls.