我正在尝试使用MAMP在本地开发,但是我的perl脚本无法连接到我的mysql数据库。当我查看apache日志时,我看到" install_driver(mysql)失败:无法在@ INC"中找到DBD / mysql.pm. 当我运行>哪个perl我得到了perl安装的位置,并将其添加到我的MAMP配置文件中的perl路径。
我还尝试使用安装DMD :: MySql CPAN [1]>安装DBD :: mysql 但它最终失败了。我在下面列出了cpan安装过程的日志。我希望有人对我有所了解。 我对这些东西很陌生,现在已经尝试了一段时间。
非常感谢任何人可能提供的任何帮助 感谢
**** cpan log ****
Checking if your kit is complete...
Looks good
Using DBI 1.636 (for perl 5.016000 on darwin-2level) installed in /Users/archie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/DBI/
Writing Makefile for DBD::mysql
Wide character in print at /Users/archie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/ExtUtils/MakeMaker.pm line 1028.
Wide character in print at /Users/archie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/ExtUtils/MakeMaker.pm line 1028.
Writing MYMETA.yml and MYMETA.json
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/Users/archie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/DBI -I/usr/local/Cellar/mysql/5.7.14/include/mysql -fno-omit-frame-pointer -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O3 -DVERSION=\"4.040\" -DXS_VERSION=\"4.040\" "-I/Users/archie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/darwin-2level/CORE" dbdimp.c
/Users/archie/perl5/perlbrew/perls/perl-5.16.0/bin/perl -p -e "s/~DRIVER~/mysql/g" /Users/archie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/DBI/Driver.xst > mysql.xsi
/Users/archie/perl5/perlbrew/perls/perl-5.16.0/bin/perl /Users/archie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/ExtUtils/xsubpp -typemap /Users/archie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 249
Warning: duplicate function definition 'rows' detected in mysql.xs, line 673
cc -c -I/Users/archie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/DBI -I/usr/local/Cellar/mysql/5.7.14/include/mysql -fno-omit-frame-pointer -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -O3 -DVERSION=\"4.040\" -DXS_VERSION=\"4.040\" "-I/Users/archie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/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/Cellar/mysql/5.7.14/lib:/usr/lib" env MACOSX_DEPLOYMENT_TARGET=10.3 cc -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.bundle \
-L/usr/local/Cellar/mysql/5.7.14/lib -lmysqlclient -lssl -lcrypto \
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [blib/arch/auto/DBD/mysql/mysql.bundle] Error 1
MICHIELB/DBD-mysql-4.040.tar.gz
/usr/bin/make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
MICHIELB/DBD-mysql-4.040.tar.gz : make NO
答案 0 :(得分:0)
make报告了一个丢失的库(ssl)。您必须先安装ssl库。 或者您可以尝试安装和使用DBD :: mysqlPP