如果想要用Python链接mysql,需要先安装MySQL-python,
步骤1:
执行:pip install MySQL-python
如果报以下错误:
EnvironmentError: mysql_config not found
----------------------------------------
Command python setup.py egg_info failed with error code 1
则需要先执行:
sudo apt-get install build-essential python-dev libmysqlclient-dev
然后再执行步骤1.
参考:
http://stackoverflow.com/questions/7459766/installing-mysql-python