Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing perl DBD::mysql fails on Mac Sierra with mysql brew install

Trying to install DBD::mysql on my Mac Sierra computer running mysql v 5.7.17. Getting the following error when trying to install with cpanm install DBD::mysql:

Checking if libs are available for compiling... Can't link/include C library 'ssl', 'crypto', aborting.

Other solutions I have found so far don't address this issue with Sierra.

like image 398
StevieD Avatar asked Mar 31 '17 00:03

StevieD


People also ask

How do I install DBD mysql in ActivePerl?

Strawberry Perl comes bundled with DBD::mysql and the needed client libraries. ActivePerl offers a PPM archive of DBD::mysql. All you need to do is typing in a cmd.exe window: This will fetch the module via HTTP and install them. If you need to use a WWW proxy server, the environment variable HTTP_proxy must be set:

Does this install DBD::mysql into the Perl hierarchy?

This installs DBD::mysql into the Perl hierarchy. This was tested with MySQL version 3.23.54a and DBD::mysql version 2.1022. I patched the above mentioned test scripts and sent the patches to the author of DBD::mysql Jochen Wiedman. Georg Rehfeld 15. Jan. 2003 Some Linux distributions don't come with a gzip library by default.

Do I need A C compiler to run DBD mysql?

This may require choosing a "Custom installation" and selecting the appropriate option when running the MySQL setup program. DBD::mysql is a DBI driver, hence you need DBI. It is available from the same source where you got the DBD::mysql distribution from. A C compiler is only required if you install from source.

What do I need to install MySQL on Strawberry Perl?

Late versions of MySQL come with support for compression. Thus it may be required that you have install an RPM package like libz-devel, libgz-devel or something similar. Binary installation is possible in the most cases, depending on your system. Strawberry Perl comes bundled with DBD::mysql and the needed client libraries.


1 Answers

You can pass libs and cflags arg to help Makefile.PL find the libaries on the machine (in my case the openssl libraries were installed with homebrew):

cpanm --configure-args="--libs='-L/usr/local/opt/openssl/lib -L/usr/local/Cellar/mysql/5.7.17/lib' --cflags='-I/usr/local/opt/openssl/include -I/usr/local/Cellar/mysql/5.7.17/include/mysql'" DBD::mysql

like image 130
StevieD Avatar answered Sep 29 '22 02:09

StevieD