centos6.5(64bit),python2.6.6安装MySQLdb模块

1、下载MySQL-python、setuptools安装包

2、tar zxvf setuptools-0.6c11.tar.gz

3、cd setuptools-0.6c11

4、python setup.py install

注意:如果安装过程中报错,error: command 'gcc' failed with exit status 1。则需要安装python-devel,执行命令yum -y install python-devel

5、unzip MySQL-python-1.2.5.zip

6、cd MySQL-python-1.2.5

7、 python setup.py install

安装完成。在python下输入import MySQLdb检查是否报错,无报错则安装正常。

原文地址:https://www.cnblogs.com/tiantianhappy/p/9034916.html