Install MySQL in python-python
1. first download mysql for python,: http://sourceforge.net/projects/mysql-python/
2. decompress the package, enter the directory, and then execute:
python setup.py buildpython setup.py install
Run: During build, EnvironmentError: mysql_config not found may be reported;
At this time, run sudo apt-get install libmysqld-dev first, and then find/-name mysql_config in/usr/bin /.
Then modify the site. cfg file under the MySQL-python-1.2.4b4 directory to remove the comment of mysql_config = XXX, and change it to mysql_config =/usr/bin/mysql_config (take the directory on the machine where the mysql_config file is located as the standard)
3. execute python setup. py build and python setup install;
Here, the second error may be reported: _ mysql. c: 29: 20: fatal error: Python. h:
The solution is to install python-dev: sudo apt-get install python-dev
4. okay. finally, execute python setup. py build and python setup install. everything is done.