StevieD
StevieD

Reputation: 7443

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.

Upvotes: 5

Views: 2642

Answers (2)

Gedge
Gedge

Reputation: 315

This worked for me:

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

Upvotes: 0

StevieD
StevieD

Reputation: 7443

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

Upvotes: 8

Related Questions