For those of you who install MySQL v5.7 with Brew
Remove mysql-connector-c
$ brew uninstall mysql-connector-c
Install a specific version, most likely you need to remove other installed versions
$ brew install mysql@5.7
You will need to add it to PATH , as these are โbarrel-onlyโ formulas, they print after installation
$ echo 'export PATH="/usr/local/opt/ mysql@5.7 /bin:$PATH"' >> ~/.zshrc
Replace ~/.zshrc with the appropriate file.
Install mysql-connector-c
$ brew install mysql-connector-c
Check if it is installed correctly
$ which mysql
Now install mysqlclient
$ pip install mysqlclient
Edgar ortega
source share