MySQL Forums
Forum List  »  Perl

DBD::MySql on MAMP for Mac OS X 10.4.11 - install problem
Posted by: Brad Kirby
Date: March 24, 2008 11:54AM

Hi All,

Using MAMP 1.7 on Mac OS X 10.4.11
MySql client API version 5.0.41

Trying to configure system so I can run Perl scripts connecting to MySql db. Figured out I need to install the following modules:

DBI-1.602
DBD-mysql-4.006

Which I downloaded from CPAN. Followed instructions from the following sites:

http://www.nargalzius.com/blog/archives/2005/09/2005_09_16_2327PM.php
http://tribolum.com/archives/2006/12/13/movabletype_on_.php

As they were the only ones I could find relating specifically to MAMP. Im having problems that I think are related to the dynamic libraries.

The DBI install seemed to go ok, although there was a lot of subtests that were skipped. The DBD::MySql install is going as follows:

-----------------------------------------------------------------------

Brad-Kirbys-Computer:/library/perl/dbd-mysql-4.006 bradkirby$ sudo Perl Makefile.PL --mysql_config=/Applications/MAMP/Library/bin/mysql_config
Password:
I will use the following settings for compiling and testing:

cflags (mysql_config) = -I/Applications/MAMP/Library/include
embedded (mysql_config) =
libs (mysql_config) = -L/Applications/MAMP/Library/lib/mysql -lmysqlclient -lz -lm
mysql_config (Users choice) = /Applications/MAMP/Library/bin/mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testsocket (default ) =
testuser (default ) =

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Using DBI 1.602 (for perl 5.008006 on darwin-thread-multi-2level) installed in /Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBI/
Writing Makefile for DBD::mysql
Brad-Kirbys-Computer:/library/perl/dbd-mysql-4.006 bradkirby$ sudo make
cc -c -I/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBI -I/Applications/MAMP/Library/include -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"4.006\" -DXS_VERSION=\"4.006\" "-I/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE" dbdimp.c
cc -c -I/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBI -I/Applications/MAMP/Library/include -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -Os -DVERSION=\"4.006\" -DXS_VERSION=\"4.006\" "-I/System/Library/Perl/5.8.6/darwin-thread-multi-2level/CORE" mysql.c
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.bundle
LD_RUN_PATH="/Applications/MAMP/Library/lib/mysql" /usr/bin/Perl myld env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -L/usr/local/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.bundle -L/Applications/MAMP/Library/lib/mysql -lmysqlclient -lz -lm
chmod 755 blib/arch/auto/DBD/mysql/mysql.bundle
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Manifying blib/man3/DBD::mysql.3pm
Manifying blib/man3/DBD::mysql::INSTALL.3pm
Manifying blib/man3/Bundle::DBD::mysql.3pm
Brad-Kirbys-Computer:/library/perl/dbd-mysql-4.006 bradkirby$
-----------------------------------------------------------------------

When I run Sudo make test, everything fails and im told that perhaps a required shared library or dll isn't installed where expected.

Ive tried switching the libs address to point to a static library (libmysqlclient.a which I copied into a temporary static lib folder) as suggested in the INSTALL.html file, but I still get the same results and im informed that "-bundle -undefined dynamic_lookup -L/usr/local/lib dbdimp.o mysql.o" - why is it looking here for this when i have told it to look elsewhere for static library?

When I run a perl script that connects to a mysql db, I get:

Brad-Kirbys-Computer:/applications/mamp/cgi-bin bradkirby$ perl -Tw dbconnect.pl
dyld: lazy symbol binding failed: Symbol not found: _mysql_server_init
Referenced from: /Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
Expected in: dynamic lookup

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

Trace/BPT trap
Brad-Kirbys-Computer:/applications/mamp/cgi-bin bradkirby$
-----------------------------------------------------------------------

Which I presume means that I havent been able to get it to use the static library instead of the dynamic one?

Ive read the bugfix http://bugs.mysql.com/bug.php?id=28544 but don't fully understand it, and not sure if thats totally different because not specific to using MAMP. The fixes offered on the two sites I mentioned above don't appear to work either.

If it helps, I first tried an auto install from the CPAN site, but that failed. Not sure if that would affect these later manual attempts as I didnt delete anything afterwards.

Sorry if this is long winded, pretty new to all this configuration.

Bit confused over the references to .o files which I believe are dynamic libraries - in my MAMP set up I cant see any of these files yet I can see .dylib files which I would guess are dynamic libraries?

Was hoping someone could point me in the right direction, or let me know what information would be useful for me to add to this post?

Many thanks in advance
Brad

Options: ReplyQuote


Subject
Written By
Posted
DBD::MySql on MAMP for Mac OS X 10.4.11 - install problem
March 24, 2008 11:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.