Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Installing DBD::mysql on Mac OS X 10.6

Status
Not open for further replies.

MacTommy

Programmer
Feb 26, 2007
116
0
0
NL
I seem to run into the same problems as others. I read the other threads on this forum but I can't seem to solve my problems.
I am sorry if I overlooked something and double-posted.

What I am trying to do is install DBD::mysql with cpan on Mac OS X 10.6.8 (64 bits).
First, by the way, I installed DBI with cpan, which went like a charm.
Then I did (as root)

Code:
cpan> get DBD::mysql
After that I went to the directory it was downloaded in became root. Then I said:
Code:
perl Makefile.PL --testuser='myself' --testpassword='mypassword' --mysql_config=/usr/local/mysql/bin/mysql_config
That seemed to work alright:
Code:
I will use the following settings for compiling and testing:

  cflags        (mysql_config ) = -I/usr/local/mysql/include  -Os -g -fno-common -fno-strict-aliasing -arch x86_64
  embedded      (mysql_config ) = 
  libs          (mysql_config ) = -L/usr/local/mysql/lib -lmysqlclient   -lpthread
  mysql_config  (Users choice ) = /usr/local/mysql/bin/mysql_config
  nocatchstderr (default      ) = 0
  nofoundrows   (default      ) = 0
  ssl           (guessed      ) = 0
  testdb        (default      ) = test
  testhost      (default      ) = 
  testpassword  (User's choice) = myself
  testsocket    (default      ) = 
  testuser      (User's choice) = mypassword

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

Multiple copies of Driver.xst found in: /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/ /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level/auto/DBI/ at Makefile.PL line 928
Using DBI 1.616 (for perl 5.010000 on darwin-thread-multi-2level) installed in /Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBI/
Writing Makefile for DBD::mysql
Writing MYMETA.yml and MYMETA.json

which reflects my mysql_config settings:

Code:
$ mysql_config
Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
Options:
        --cflags         [-I/usr/local/mysql/include  -Os -g -fno-common -fno-strict-aliasing -arch x86_64]
        --include        [-I/usr/local/mysql/include]
        --libs           [-L/usr/local/mysql/lib -lmysqlclient   -lpthread]
        --libs_r         [-L/usr/local/mysql/lib -lmysqlclient_r   -lpthread]
        --plugindir      [/usr/local/mysql/lib/plugin]
        --socket         [/tmp/mysql.sock]
        --port           [0]
        --version        [5.6.2-m5]
        --libmysqld-libs [-L/usr/local/mysql/lib -lmysqld    -lpthread]
        --variable=VAR   VAR is one of:
                pkgincludedir [/usr/local/mysql/include]
                pkglibdir     [/usr/local/mysql/lib]
                plugindir     [/usr/local/mysql/lib/plugin]

However, if I do 'make' it gives a lot of warnings.
And 'make test' crashes, like this:
Code:
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base....................ok 1/6                                           
#   Failed test 'use DBD::mysql;'
#   at t/00base.t line 21.
#     Tried to use 'DBD::mysql'.
#     Error:  Can't load '/Users/mactommy/.cpan/build/DBD-mysql-4.020-NaxWTi/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/mactommy/.cpan/build/DBD-mysql-4.020-NaxWTi/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.16.dylib
#   Referenced from: /Users/mactommy/.cpan/build/DBD-mysql-4.020-NaxWTi/blib/arch/auto/DBD/mysql/mysql.bundle
#   Reason: image not found at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207.
#  at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
t/00base....................NOK 2/6FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 9

According to some other posts it might have to do with MySQL not running in 64-bit mode. I did download the 64 bit version, but admittedly, if I check in MySQL it says this:
Code:
mysql> show variables like 'version_compile_machine'; 
+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| version_compile_machine | i386  |
+-------------------------+-------+
1 row in set (0.01 sec)

Even though the 'file' command says this:
Code:
$ file /usr/local/mysql/bin/mysqld
/usr/local/mysql/bin/mysqld: Mach-O 64-bit executable x86_64

Does somebody have any suggestions on where to go now..?!?

Any help is really appreciated. Thanks!!

Tom
 
Does libmysqlclient.16.dylib exist in /usr/local/mysql/lib? If not, you could try finding where it does exist on your system and then create a softlink from there to /usr/local/mysql/lib i.e.

ln -s /usr/local/mysql/lib/*.dylib

Putting the path to where libmysqlclient.16.dylib exists in LIBRARY_LD_PATH might achieve the same effect.
 
Yes, it does:
Code:
$ ls -l /usr/local/mysql/lib/libmysqlclient.16.dylib 
-rwxr-xr-x  1 root  wheel  4142080 Mar 14  2011 /usr/local/mysql/lib/libmysqlclient.16.dylib
 
And also it says:

Error: Can't load '/Users/mactommy/.cpan/build/DBD-mysql-4.020-NaxWTi/blib/arch/auto/DBD/mysql/mysql.bundle'

Even though:
Code:
$ ls -l /Users/mactommy/.cpan/build/DBD-mysql-4.020-NaxWTi/blib/arch/auto/DBD/mysql/mysql.bundle 
-rwxr-xr-x  1 root  staff  428852 Sep 13 12:10 /Users/mactommy/.cpan/build/DBD-mysql-4.020-NaxWTi/blib/arch/auto/DBD/mysql/mysql.bundle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top