Leser: 12
QuoteIMac20:DBD-mysql-4.012 pktm$ sudo 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
cc -c -I/Library/Perl/5.8.8/darwin-thread-multi-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 -arch ppc -arch i386 -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3 -DVERSION=\"4.012\" -DXS_VERSION=\"4.012\" "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE" dbdimp.c
dbdimp.c: In function ‘alloc_param’:
dbdimp.c:113: warning: comparison is always false due to limited range of data type
dbdimp.c: In function ‘alloc_bind’:
dbdimp.c:131: warning: comparison is always false due to limited range of data type
dbdimp.c: In function ‘alloc_fbind’:
dbdimp.c:147: warning: comparison is always false due to limited range of data type
dbdimp.c: In function ‘alloc_fbuffer’:
dbdimp.c:162: warning: comparison is always false due to limited range of data type
dbdimp.c: In function ‘mysql_describe’:
dbdimp.c:3309: warning: assignment from incompatible pointer type
dbdimp.c: In function ‘mysql_describe’:
dbdimp.c:3309: warning: assignment from incompatible pointer type
dbdimp.c: In function ‘mysql_describe’:
dbdimp.c:3309: warning: assignment from incompatible pointer type
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI/Driver.xst > mysql.xsi
/usr/bin/perl /System/Library/Perl/5.8.8/ExtUtils/xsubpp -typemap /System/Library/Perl/5.8.8/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 -c -I/Library/Perl/5.8.8/darwin-thread-multi-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 -arch ppc -arch i386 -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3 -DVERSION=\"4.012\" -DXS_VERSION=\"4.012\" "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE" mysql.c
mysql.xs: In function ‘XS_DBD__mysql__db_do’:
mysql.xs:330: warning: comparison is always false due to limited range of data type
mysql.xs:331: warning: comparison is always false due to limited range of data type
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" /usr/bin/perl myld cc -mmacosx-version-min=10.5.7 -arch ppc -arch i386 -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
IMac20:DBD-mysql-4.012 pktm$ sudo make test
PERL_DL_NONLAZY=1 /usr/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 load '/Users/pktm/Desktop/cpan/DBD-mysql-4.012/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/pktm/Desktop/cpan/DBD-mysql-4.012/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Symbol not found: _is_prefix
# Referenced from: /Users/pktm/Desktop/cpan/DBD-mysql-4.012/blib/arch/auto/DBD/mysql/mysql.bundle
# Expected in: dynamic lookup
# at (eval 6) line 2
# Compilation failed in require at (eval 6) line 2.
# BEGIN failed--compilation aborted at (eval 6) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 255
IMac20:DBD-mysql-4.012 pktm$
QuoteHi Charlie,
I had the same problem on both Tiger and Leopard. It seems that the newer mysql builds have moved
some of the libraries and the config files haven't caught up.
The article/blog that helped me is:
http://jayallen.org/journey/2006/04/dbd-mysql-buil...
The simplest solution for me is towards the end in the comments mentioning creating links
from where it thinks it should be to the new location, the solution that I used.
ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
ln -s /usr/local/mysql/include /usr/local/mysql/include/mysql
(use sudo as needed)
imac24:~ root# ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
ln: /usr/local/mysql/lib/mysql/lib: File exists
imac24:~ root# ln -s /usr/local/mysql/include /usr/local/mysql/include/mysql
ln: /usr/local/mysql/include/mysql/include: File exists
imac24:~ root# perl -MCPAN -e 'install DBD::mysql'
imac24:bin root# ./mysql_config --libs
-L/usr/local/mysql-5.0.51b-osx10.4-i686/lib/mysql -lmysqlclient -lz -lm
mysql-5.0.67-osx10.5-x86.dmg
PATH=$PATH:/usr/local/mysql/bin
export PATH
imac24:~ root# perl -MCPAN -e 'force install DBD::mysql'
QuotePHP in Leopard (OS X 10.5) looks for the socket at /var/mysql/mysql.sock
The MySQL 5.0.45 installer by makes a socket at /tmp/mysql.sock
sudo mkdir /var/mysql
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
sudo chown _mysql /var/mysql/mysql.sock
sudo chmod 777 /var/mysql/mysql.sock
Then my old PHP code works with MySQL.