Python的MySQLdb模块安装

首先,请安装mysql

sudo apt-get install mysql

期间,需要设置root 密码

yum -y install mysql-devel
下载mysql
-python: http://jaist.dl.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz 解压: tar -zxvf MySQL-python-1.2.3.tar.gz
 进到该目录: cd   MySQL-python-1.2.3.tar.gz
 执行安装脚本: python setup.py build
        python setup.py install

 

出现上述错误,需要按照下面3个rpm包

 


http://mirrors.vpsmate.org/CentALT/repository/centos/6/x86_64/mysql-5.5.27-1.el6.x86_64.rpm
http://mirrors.vpsmate.org/CentALT/repository/centos/6/x86_64/mysql-libs-5.5.27-1.el6.x86_64.rpm
http://mirrors.vpsmate.org/CentALT/repository/centos/6/x86_64/mysql-devel-5.5.27-1.el6.x86_64.rpm

 
posted @ 2016-03-12 20:41  fengjian1585  阅读(200)  评论(0编辑  收藏  举报