安装MySQL-python模块
yuminstallMySQL-python-y
先安装 setuptools
wgethttp://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#解压后
pythonsetup.pybuild
pythonsetup.pyinstall
安装一些扩展库
yum-yinstallrpm-buildgcc-c++mysql-develpython-devel
安装MySQL-python
wgethttp://download.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.3.tar.gz
解压进入安装目录。
编辑site.cfg,把mysql_config那一行取消注释,并改为:
mysql_config=/usr/lib64/mysql/mysql_config(根据自己mysql安装位置定义)
pythonsetup.pybuild
pythonsetup.pyinstall
测试安装
python
>>>importMySQLdb