One. Installation
Install the setuptools required by Python setup.py first
Yum Install Python-setuptools
MYSQLDB Module
Download
wget Https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip
Installation
Unzip Mysql-python-1.2.5.zip
CD mysql-python-1.2.5
Python setup.py Build
(See below for an error)
Python setup.py Install
Ok
Two. Error and resolution
Python setup.py build time
Wrong
Error:mysql_config not found found Mysql_config
Solve
Find/-name Mysql_config/data/mysql5537/bin/mysql_config
Modify the setup_posix.py file on line 27:
Mysql_config.path = "Mysql_config" modified to:
Mysql_config.path = "/data/mysql5537/bin/mysql_config"
Wrong
Error: Python.h: No file or directory missing Python development
Yum Install Python-devel
Wrong execution python 1sql.py time error
importerror:libmysqlclient.so.18 error, unable to find the so file for MySQL
Ln-s/data/mysql5536/lib/libmysqlclient.so.18/usr/lib/libmysqlclient.so.18
This article is from the "Cloud Notepad" blog, please be sure to keep this source http://youngcloud.blog.51cto.com/2873694/1673151
Installing the MYSQLDB module