On Wed, Dec 23, 2009 at 1:01 PM, Peter Hesp <[email protected]> wrote:

> Hi Jonathan and thanks,
>
> Here is the output of DBD-mysql as requested.
>

Dear Peter,

I intended you to send the extra information to the DBI Users mailing list.
Indeed, we could argue that you need a new subject line - the problem is not
installing DBI but installing DBD::MySQL on MacOS X.

I don't currently have MySQL configured for use on MacOS X.  However, I do
have DBD::mysql 4.013 installed - so I didn't have any self-evident problems
(or maybe I force installed it despite problems...I occasionally do that for
non-critical modules).

Let's see:

The build phase proceeded more-or-less normally - but the test failed almost
identically:

Using DBI 1.609 (for perl 5.010001 on darwin-2level) installed in
/Users/jleffler/perl/v5.10.1/lib/site_perl/5.10.1/darwin-2level/auto/DBI/
Writing Makefile for DBD::mysql
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cc -m32 -c
-I/Users/jleffler/perl/v5.10.1/lib/site_perl/5.10.1/darwin-2level/auto/DBI
-I/usr/local/mysql/include  -g -Os -arch x86_64 -fno-common
-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ
-DIGNORE_SIGHUP_SIGQUIT  -DDONT_DECLARE_CXA_PURE_VIRTUAL
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
-I/usr/gnu/include -O3   -DVERSION=\"4.013\" -DXS_VERSION=\"4.013\"
"-I/Users/jleffler/perl/v5.10.1/lib/5.10.1/darwin-2level/CORE"   dbdimp.c
dbdimp.c: In function ‘mysql_st_internal_execute41’:
dbdimp.c:3085: warning: format ‘%d’ expects type ‘int’, but argument 3 has
type ‘my_ulonglong’
dbdimp.c: In function ‘mysql_describe’:
dbdimp.c:3305: warning: format ‘%d’ expects type ‘int’, but argument 5 has
type ‘long unsigned int’
dbdimp.c:3309: warning: format ‘%d’ expects type ‘int’, but argument 3 has
type ‘long unsigned int’
dbdimp.c: In function ‘mysql_st_fetch’:
dbdimp.c:3526: warning: format ‘%d’ expects type ‘int’, but argument 3 has
type ‘long int’
dbdimp.c:3568: warning: format ‘%08lx’ expects type ‘long unsigned int’, but
argument 3 has type ‘struct MYSQL_RES *’
dbdimp.c:3570: warning: format ‘%llu’ expects type ‘long long unsigned int’,
but argument 3 has type ‘unsigned int’
dbdimp.c: In function ‘mysql_st_FETCH_attrib’:
dbdimp.c:4153: warning: format ‘%d’ expects type ‘int’, but argument 3 has
type ‘my_ulonglong’
dbdimp.c: In function ‘mysql_bind_ph’:
dbdimp.c:4335: warning: format ‘%d’ expects type ‘int’, but argument 3 has
type ‘IV’
dbdimp.c:4353: warning: format ‘%d’ expects type ‘int’, but argument 3 has
type ‘IV’
dbdimp.c:4380: warning: format ‘%d’ expects type ‘int’, but argument 3 has
type ‘IV’
/Users/jleffler/perl/v5.10.1/bin/perl -p -e "s/~DRIVER~/mysql/g"
/Users/jleffler/perl/v5.10.1/lib/site_perl/5.10.1/darwin-2level/auto/DBI/Driver.xst
> mysql.xsi
/Users/jleffler/perl/v5.10.1/bin/perl
/Users/jleffler/perl/v5.10.1/lib/5.10.1/ExtUtils/xsubpp  -typemap
/Users/jleffler/perl/v5.10.1/lib/5.10.1/ExtUtils/typemap  mysql.xs >
mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 650
cc -m32 -c
-I/Users/jleffler/perl/v5.10.1/lib/site_perl/5.10.1/darwin-2level/auto/DBI
-I/usr/local/mysql/include  -g -Os -arch x86_64 -fno-common
-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ
-DIGNORE_SIGHUP_SIGQUIT  -DDONT_DECLARE_CXA_PURE_VIRTUAL
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
-I/usr/gnu/include -O3   -DVERSION=\"4.013\" -DXS_VERSION=\"4.013\"
"-I/Users/jleffler/perl/v5.10.1/lib/5.10.1/darwin-2level/CORE"   mysql.c
mysql.xs: In function ‘XS_DBD__mysql__GetInfo_dbd_mysql_get_info’:
mysql.xs:741: warning: format ‘%i’ expects type ‘int’, but argument 2 has
type ‘struct SV *’
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.bundle
LD_RUN_PATH="/usr/local/mysql/lib" /Users/jleffler/perl/v5.10.1/bin/perl
myld env MACOSX_DEPLOYMENT_TARGET=10.3 cc -m32  -bundle -undefined
dynamic_lookup -L/usr/local/lib -L/usr/gnu/lib -fstack-protector dbdimp.o
mysql.o  -o blib/arch/auto/DBD/mysql/mysql.bundle     \
       -L/usr/local/mysql/lib -lmysqlclient -lz -lm -lmygcc      \

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.3
Manifying blib/man3/DBD::mysql::INSTALL.3
Manifying blib/man3/Bundle::DBD::mysql.3
PERL_DL_NONLAZY=1 /Users/jleffler/perl/v5.10.1/bin/perl
"-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')"
t/*.t
t/00base.t .................. 1/6 Bailout called.  Further testing stopped:
Unable to load DBD::mysql

#   Failed test 'use DBD::mysql;'
#   at t/00base.t line 21.
#     Tried to use 'DBD::mysql'.
#     Error:  Can't find 'boot_DBD__mysql' symbol in
/Users/jleffler/.cpanplus/5.10.1/build/DBD-mysql-4.013/blib/arch/auto/DBD/mysql/mysql.bundle
#  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 255

I'm using DBI 1.609 (as this output says).  I'm concerned about the
doubly-defined functions:

Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 650


I see in the mysql.o file the boot function - with an underscore in front of
its name...

$ nm -og *.o | grep boot
mysql.o: 0000000000000000 T _boot_DBD__mysql
mysql.o: 0000000000017fd0 S _boot_DBD__mysql.eh
$


I'm using Perl 5.10.1 - originally built on MacOS X 10.5.x but running on
10.6.x.

I have had to futz with my Perl configuration to change 'cc' to 'cc -m32' to
ensure that it does 32-bit builds.  However, I've been able to compile
numerous other C/XS modules since fixing that.



> peter-hesps-macbook:DBD-mysql-4.013 peterhesp$ make realclean
> rm -f \
>          *.a core \
>          core.[0-9] blib/arch/auto/DBD/mysql/extralibs.all \
>          core.[0-9][0-9] mysql.bso \
>          pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \
>          mysql.x mysql.bs \
>          perl tmon.out \
>          *.o pm_to_blib \
>          blib/arch/auto/DBD/mysql/extralibs.ld mysql.c \
>          blibdirs.ts core.[0-9][0-9][0-9][0-9][0-9] \
>          *perl.core core.*perl.*.? \
>          Makefile.aperl perl \
>          mysql.def core.[0-9][0-9][0-9] \
>          mon.out libmysql.def \
>          perlmain.c perl.exe \
>          so_locations mysql.exp
> rm -rf \
>          *.xsi blib
> mv Makefile Makefile.old > /dev/null 2>&1
> rm -f \
>          dbdimp.o mysql.o Makefile.old \
>          Makefile
> rm -rf \
>          t/mysql.mtest DBD-mysql-4.013
>
> ____________________________________________________________________________
>
> peter-hesps-macbook:DBD-mysql-4.013 peterhesp$ perl Makefile.PL
> --mysql_config=/usr/local/mysql/bin/mysql_config
>
>
> PLEASE NOTE:
>
> For 'make test' to run properly, you must ensure that the
> database user 'peterhesp' can connect to your MySQL server
> and has the proper privileges that these tests require such
> as 'drop table', 'create table', 'drop procedure', 'create procedure'
> as well as others.
>
> mysql> grant all privileges on test.* to 'peterhesp'@'localhost'
> identified by 's3kr1t';
>
> You can also optionally set the user to run 'make test' with:
>
> perl Makefile.pl --testuser=username
>
> I will use the following settings for compiling and testing:
>
>  cflags        (mysql_config) = -I/usr/local/mysql/include  -g -Os -arch
> i386 -fno-common   -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE
> -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT
> -DDONT_DECLARE_CXA_PURE_VIRTUAL
>  embedded      (mysql_config) =
>  libs          (mysql_config) = -L/usr/local/mysql/lib -lmysqlclient -lz
> -lm     -lmygcc
>  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  (default     ) =
>  testsocket    (default     ) =
>  testuser      (guessed     ) = peterhesp
>
> To change these settings, see 'perl Makefile.PL --help' and
> 'perldoc INSTALL'.
>
> Checking if your kit is complete...
> Looks good
> Using DBI 1.609 (for perl 5.008009 on darwin-2level) installed in
> /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI/
> Writing Makefile for DBD::mysql
> peter-hesps-macbook:DBD-mysql-4.013 peterhesp$ make
> cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
> cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
> cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
> cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
> /usr/bin/gcc-4.2 -c
> -I/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI
> -I/usr/local/mysql/include  -g -Os -arch i386 -fno-common
> -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ
> -DIGNORE_SIGHUP_SIGQUIT  -DDONT_DECLARE_CXA_PURE_VIRTUAL
> -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-common -DPERL_DARWIN
> -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -pipe
> -I/usr/local/include -I/opt/local/include -O3   -DVERSION=\"4.013\"
> -DXS_VERSION=\"4.013\"  "-I/opt/local/lib/perl5/5.8.9/darwin-2level/CORE"
>  dbdimp.c
> /opt/local/bin/perl -p -e "s/~DRIVER~/mysql/g"
> /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI/Driver.xst >
> mysql.xsi
> /opt/local/bin/perl /opt/local/lib/perl5/5.8.9/ExtUtils/xsubpp  -typemap
> /opt/local/lib/perl5/5.8.9/ExtUtils/typemap  mysql.xs > mysql.xsc && mv
> mysql.xsc mysql.c
> Warning: duplicate function definition 'do' detected in mysql.xs, line 225
> Warning: duplicate function definition 'rows' detected in mysql.xs, line
> 650
> /usr/bin/gcc-4.2 -c
> -I/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBI
> -I/usr/local/mysql/include  -g -Os -arch i386 -fno-common
> -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ
> -DIGNORE_SIGHUP_SIGQUIT  -DDONT_DECLARE_CXA_PURE_VIRTUAL
> -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -fno-common -DPERL_DARWIN
> -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -pipe
> -I/usr/local/include -I/opt/local/include -O3   -DVERSION=\"4.013\"
> -DXS_VERSION=\"4.013\"  "-I/opt/local/lib/perl5/5.8.9/darwin-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="/usr/local/mysql/lib" /opt/local/bin/perl myld env
> MACOSX_DEPLOYMENT_TARGET=10.3 /usr/bin/gcc-4.2  -L/opt/local/lib -bundle
> -undefined dynamic_lookup -L/usr/local/lib dbdimp.o mysql.o  -o
> blib/arch/auto/DBD/mysql/mysql.bundle   \
>           -L/usr/local/mysql/lib -lmysqlclient -lz -lm -lmygcc         \
>
> 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
>
>
> ____________________________________________________________________________
> # Ooops. Test not so good.
>
> peter-hesps-macbook:DBD-mysql-4.013 peterhesp$ 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 find 'boot_DBD__mysql' symbol in
>
> /Users/peterhesp/Downloads/DBD-mysql-4.013/blib/arch/auto/DBD/mysql/mysql.bundle
> #  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
> peter-hesps-macbook:DBD-mysql-4.013 peterhesp$
>
> ____________________________________________________________________________
>
> > On Tue, Dec 22, 2009 at 10:03 PM, Peter Hesp <[email protected]>
> wrote:
> >
> >> Hi and merry Xmas,,
> >> I have been trying install DBI for mysql on my, recently upgraded to
> >> 'snow
> >> leopard', Mac Book with no luck.
> >>
> >> I have included the requested output from the installation  process,
> >> which
> >> appeared to me to be OK but when tried my test script also included I
> >> could not connect to the database.
> >>
> >> If you can check this out and advise of a solution or direct me to on it
> >> would be greatly appreciated.
> >>
> >> Thanks
> >>
> >> Peter Hesp.
> >>
> >> peter-hesps-macbook:DBI-1.609 peterhesp$ perl Makefile.PL
> >> Your perl was compiled with gcc (version 4.2.1 (Apple Inc. build 5646)),
> >> okay.
> >>
> >
> >
> > [...log of successful build of DBI stripped...]
> >
> >
> >
> >
> >> All tests successful, 34 tests and 379 subtests skipped.
> >> Files=130, Tests=5825, 46 wallclock secs (36.79 cusr +  6.54 csys =
> >> 43.33
> >> CPU)
> >>
> >
> >
> >
> >>
> ___________________________________________________________________________
> >> A TEST SCRIPT TO CONNECT TO THE DB
> >>
> >> #!/opt/local/bin/perl -w
> >> use strict;
> >> use DBI;
> >>
> >> my ( $user, $passwd, $connString);
> >>
> >> ($connString, $user, $passwd) =
> >> ("dbi:mysql:database=contacts;host=localhost", 'root','*******');
> >> my $dbh = DBI->connect($connString)
> >>                or die "Couldn't connect to database: " . DBI->errstr;
> >> my $sth = $dbh->prepare('SELECT * FROM people ')
> >>        or die "Couldn't prepare statement: " . $dbh->errstr;
> >>
> >> $sth->execute() ;
> >>
> >> AND ITS OUTPUT
> >>
> >> peter-hesps-macbook:cgi-bin peterhesp$ ./th_db.pl
> >> dyld: lazy symbol binding failed: Symbol not found: _mysql_init
> >>  Referenced from:
> >>
> >>
> /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBD/mysql/mysql.bundle
> >>  Expected in: dynamic lookup
> >>
> >> dyld: Symbol not found: _mysql_init
> >>  Referenced from:
> >>
> >>
> /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBD/mysql/mysql.bundle
> >>  Expected in: dynamic lookup
> >>
> >> Trace/BPT trap
> >>
> >
> >
> > Now show us the successful build of DBD::MySQL?
>
>


-- 
Jonathan Leffler <[email protected]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."

Reply via email to