安装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原文链接:https://www.f2er.com/centos/382037.html