在 Mac OS X 下安装 python-mysql方法如下:
1、先把之前装的卸载干净:
pip uninstall mysql-python
brew uninstall mysql-connector-c
2、现在设置下mysql_config路径:
首先修改系统配置文件vim ~/.bash_profile或者有些人是 ~/.profile,export PATH=$PATH:/Applications/MAMP/Library/bin
这里/Applications/MAMP/Library/bin是MAMP的mysql配置文件路径
3、安装brew install mysql-connector-cpip install mysql-python即可。