Just install Python MySQL support library, a breath encountered a series of problems, fortunately, Google, are resolved. And the record, the memo.
1. Download Python's MySQL support library
Address: http://sourceforge.net/projects/mysql-python/
2. Decompression and compilation
Python setup.py Install
First problem encountered:
_mysql.c:44:23:error:my_config.h:no such file or directory
Workaround, edit the setup_posix.py file, and set the Mysql_config.path to the MySQL directory you installed, such as/usr/local/mysql/bin/mysql_config
3. In Python "Import MySQLdb", encountered a problem:
Importerror:libmysqlclient_r.so.16:cannot open Shared object file:no such file or directory
Workaround, edit/etc/ld.so.conf.d/mysql-i386.conf file
Change to the correct MySQL installation address, such as mine: Usr/local/mysql/lib/mysql
After saving, exit, execute Ldconfig
4. Get it done, finish the call.