Phil Gyford

"Symbol not found: _mysql_init" on Leopard

Vote 0 Votes

I had MT working fine on Leopard on my old PowerBook. I recently bought a new MacBook and am having trouble getting MT up and running again.

I’ve installed DBI and DBD::mysql (CPAN says both are up to date) but when I try to access mt.cgi I get an Internal Server Error and the error logs say:

” dyld: lazy symbol binding failed: Symbol not found: mysqlinit Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle Expected in: dynamic lookup

dyld: Symbol not found: mysqlinit Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle Expected in: dynamic lookup

Premature end of script headers: mt.cgi ” I thought it might be something to do with the old PPC version of MySQL that was copied over to the new laptop but I’ve installed mysql-5.0.67-osx10.5-x86_64 and still get the error. I can access MySQL fine on the command line and via my own PHP pages.

I’ve been Googling all afternoon and can only find fixes for Ruby users with similar problems, nothing about Perl. Any ideas anyone…? Thanks.

Reported on Movable Type 4.2

9 Replies

| Add a Reply
  • (It would be *so* useful to mention Markdown must be used on the "Start Topic" page you know... And have a 'Preview' button too.)

  • http://www.entropy.ch/blog/Developer/2008/03/25/Installing-Perl-DBD-mysql-on-Mac-OS-X-10-5.html

    Perl is 32bit on Leopard, and you use a 64bit version of MySQL. Try replacing the 64 bit version of MySQL with the 32bit version.

  • Thanks Mike. Unfortunately, since posting my earlier message I've tried that but have the same problem.

    I was originally using **mysql-5.0.51a-osx10.4-powerpc** then I installed **mysql-5.0.67-osx10.5-x86\_64** and I am now on **mysql-5.0.67-osx10.5-x86** (which I assume is the 32 bit version?).

    I've have had the same error message with them all, which seems a bit odd to be honest. I'm wondering if I should uninstall DBD::mysql and reinstall it, maybe using flags like this:

    > sudo perl Makefile.PL \
    > --cflags="-I/usr/local/mysql/include -g -Os -arch i386 -fno-common"

    which I've seen mentioned elsewhere. But I don't know how to uninstall a perl module installed by CPAN...

  • I also had tried installing the 64-bit version of mysql on Leopard but had similar problems. The non-64 "x86" package is the one you want.

    Removing the existing CPAN module is just a matter of removing the files/directories under /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql and /Library/Perl/5.8.8/darwin-thread-multi-2level/DBD/mysql.

  • If you add /usr/local/mysql/bin to your path, it'll execute mysql_config and build your Makefile with all of the paths and such autodetected.

  • Phew, thanks guys.

    Mike, I already had that in my path, but I'm guessing that because I first installed DBD::mysql when I had the old PPC MySQL installed, that was when things first screwed up.

    Brad, thanks for the uninstall instructions. I did that and managed to manually install DBD::mysql (installing it via CPAN seems like a problem). And, finally, MT works!

    Thanks so much.

  • Dear Phil and others,

    I am having exactly the same problem when I am trying to access mysql from Perl. I have the 64 bit version of mysql installed on Leopard and the most recent DBD and DBI modules. mysql works and I had no problems installing DBD and DBI, which I downloaded from CPAN. From your conversion on Nov 20, I could not figure out what actually solved the problem. Can you try and summarize?

    Thanks so much!

    Tina

    The error message:


    dyld: lazy symbol binding failed: Symbol not found: _mysql_init
    Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
    Expected in: dynamic lookup

    dyld: Symbol not found: _mysql_init
    Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
    Expected in: dynamic lookup

    Trace/BPT trap

  • You should switch to the 32bit version of MySQL, remove your old copies of DBD and DBI, and rebuild them from source for the 32bit version of MySQL. You can't mix 64bit MySQL with 32bit Perl.

  • thchest, I summarised what worked for me [on my site](http://www.gyford.com/phil/writing/2008/11/20/dbd_mysql_leopard.php) although I don't think I mention anything that Mike T and Brad haven't mentioned here. Good luck!

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

code.sixapart.com

137 479

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

238 797

Last Topic: Manifest Schema Compatibility Issue When Restoring Blog by Matt on Oct 17, 2012

1858 6594

Last Topic: Categories and Basename Publishing Issues by e21media on Oct 25, 2012

88 307

Last Topic: absolute publish date in Manage Entries screen by .mau. on Apr 18, 2012

1488 5347

Last Topic: Anti-cloning by .mau. on Oct 29, 2012

732 3093

Last Topic: Blog moved server - now users cannot access blog? by mowgs on Oct 30, 2012

89 317

Last Topic: How to "pretify" a url in htaccess with a few wildcards by Caio on May 30, 2012

183 771

Last Topic: Commenting with TypePad by Rob Ferrara on Oct 17, 2012

212 680

Last Topic: Does MT-Approval work in MT5? by DLpres on Sep 25, 2012

27 100

Last Topic: Upgrading MT by Caio on Oct 15, 2012

49 224

Last Topic: Movable Type 6 Ideas by Caio on May 28, 2012

65 248

Last Topic: Expanding new rich text editor and implementing table function by Takeshi Nick Osanai on Jul 30, 2012