系统:Centos7
版本:Python2.7
先配置Perconawget https://www.percona.com/redir/downloads/percona-release/redhat/latest/percona-release-0.1-4.noarch.rpm
rpm -ivh percona-release-0.1-4.noarch.rpm
yum install Percona-Server-server-56.x86_64
配置pipyum install python-pip -y
更新pippip install --upgrade pip
安装MySQLdb模块pip install mysql-python
报错:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-JRdBT6/mysql-python/
解决:yum install mysql-devel python-devel -y
然后再使用pip install mysql-python
Collecting mysql-python
Using cached MySQL-python-1.2.5.zip
Installing collected packages: mysql-python
Running setup.py install for mysql-python ... done
Successfully installed mysql-python-1.2.5
安装成功。