wget https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zippython
unzip MySQL-python-1.2.5.zipmysql
cd MySQL-python-1.2.5sql
python setup.py buildui
报错:mysql_config not found 解决: 1)使用whereis mysql命令找到mysql安装目录,假设mysql安装在/usr/local/mysql 2) 回到MySQLdb源码目录, vi setup_posix.py打开配置文件,找到mysql_config.path一行,把路径改成mysql安装路径下bin目录,即mysql_config.path ="/usr/local/mysql/bin/mysql_config"。 若是MySQL安装在系统默认路径下,mysql_config脚本文件位于"/usr/bin/mysql_config"。(若是没有mysql_config,则须要安装mysql-devel包) 报错:error: command 'gcc' failed with exit status 1 解决: yum install gcc python-devel
python setup.py installspa