先安装mysql
sudo apt-get install mysql-server
sudo apt-get install libmysqld-dev
sudo apt-get install libmysqlclient-dev
安装MySQLdb
下载:http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz?use_mirror=nchc
解压:tar zxvf MySQL-python*
python setup.py install