I did try a lot of things, but these below set of commands finally worked for me.
1. Install mysql.
brew install mysql
2. brew unlink mysql
3. brew install mysql-connector-c
4. Add the mysql bin folder to PATH
export PATH=/usr/local/Cellar/mysql/8.0.11/bin:$PATH
5. mkdir /usr/local/Cellar/lib/
6. Create a symlink
sudo ln -s /usr/local/Cellar/mysql/8.0.11/lib/libmysqlclient.21.dylib /usr/local/Cellar/lib/libmysqlclient.21.dylib
7. brew reinstall openssl
8. Finally, install mysql-client
LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/ pip install mysqlclient
Interested in SQL ? Check out this SQL Certification by Intellipaat.
For more information visit :