ld: library not found for -lssl - Install mysqlclient for Django 2, macos


mysql server was installed by brew install mysql

Issues like this:

ERROR: Failed building wheel for mysqlclient

ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

Exception: Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?


Tried this: brew install mysql-connector-c,
but it's useless, so removed it. brew uninstall mysql-connector-c

vi /usr/local/bin/mysql_config

# Create options
libs="$libs -lmysqlclient -lssl -lcrypto"

For the virtual env,

export LDFLAGS="-L/usr/local/opt/openssl/lib" 
export CPPFLAGS="-I/usr/local/opt/openssl/include"
pip install mysqlclient

It works!