1.首先需要在mac安裝好mysql
2.遇到錯誤
error: command 'cc' failed with exit status 1
_mysql.c:44:10: fatal error: 'my_config.h' file not found
解決方案
brew install mysql-connector-c 重裝一遍這個
3.遇到錯誤 string index out of range
vim /usr/local/bin/mysql_config
修改114行
114 libs="$libs -l "
改爲 libs="$libs -lmysqlclient -lssl -lcrypto"
在安裝MYSQL-PYTHON 成功