Bug #58981 DBD::mysql 4.018 not working with latest mysql/perl
Submitted: 16 Dec 2010 17:32 Modified: 15 Feb 2013 17:13
Reporter: Murray Callander Email Updates:
Status: Unsupported Impact on me:
None 
Category:Connectors: DBD::mysql ( Perl ) Severity:S2 (Serious)
Version:4.018 OS:Mac OS X
Assigned to: CPU Architecture:Any

[16 Dec 2010 17:32] Murray Callander
Description:
DBD-mysql 4.018 still not working.

static option not available on OSX 10.6.5 running Perl 5.10 64bit (see below)

~user$ perl Makefile.PL -static -config
Unknown option: static
Unknown option: config
Usage: perl Makefile.PL [options]

$perl -v

This is perl, v5.10.0 built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)

How to repeat:
Install latest mysql and try and make or make test:

ISLID-MB-03:DBD-mysql-4.018 murraycallander$ make test
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.
t/00base....................NOK 2/6#     Tried to use 'DBD::mysql'.          
#     Error:  Can't load '/Users/murraycallander/Downloads/DBD-mysql-4.018/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/murraycallander/Downloads/DBD-mysql-4.018/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: libmysqlclient.16.dylib
#   Referenced from: /Users/murraycallander/Downloads/DBD-mysql-4.018/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.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 9
[11 Jan 2011 21:21] Brady Brown
I can reproduce this.  One further note: If you do the following env export, make test will then work:

> export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/ 

Of course, this is not really a fix since you have to always set this env variable in any shell to be able to load DBD::mysql.
[20 Feb 2011 18:20] Valeriy Kravchuk
On Mac OS X 10.5.x with MySQL server 5.5.9 installed I've got a bit different error:

macbook-pro:DBD-mysql-4.018 openxs$ make test
PERL_DL_NONLAZY=1 /opt/local/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/openxs/DBD-mysql-4.018/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/openxs/DBD-mysql-4.018/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Symbol not found: _is_prefix
#   Referenced from: /Users/openxs/DBD-mysql-4.018/blib/arch/auto/DBD/mysql/mysql.bundle
#   Expected in: dynamic lookup
#  at (eval 5) line 2
# Compilation failed in require at (eval 5) line 2.
# BEGIN failed--compilation aborted at (eval 5) line 2.
t/00base....................NOK 2/6FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 255
[1 Aug 2011 12:10] Marcel Timmerman
Same problems here while compiling DBD::mysql on Fedora Core 15. The option -static and -config as suggested on the mysql site do not exist for Makefile.PL.

In the end I found a solution to compile it right by looking into the mysql.c file where I found the use of is_prefix() on the 2531 th line. Very important comment just above it said 'Swiped from MyODBC's get_info.c'. So I looked into the libmyodbc5.so library of the mysql-connector-odbc rpm where is_prefix was found.

Then initialize the package using the --libs option;

perl Makefile.PL --libs '-L/usr/lib64/mysql -lmysqlclient -lmyodbc5 \
-lpthread -lz -lm -lrt -lssl -lcrypto -ldl'

make
make test
make install

and everything was working again
[15 Feb 2013 17:13] Sveta Smirnova
Thank you for the report.

We don't work on DBD::mysql bugs anymore. All its bugs should go to CPAN: https://rt.cpan.org/Public/Dist/Display.html?Name=DBD-mysql

I re-submitted your report to https://rt.cpan.org/Public/Bug/Display.html?id=83355
Please subscribe to the new report on CPAN and work with DBD::mysql developers in case if they need additional details.