你的位置:首页 > 网海拾贝

1. easy_install方式安装MySQLdb(新安装Python版本)

mkdir python
cd python/
wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tgz
tar xzf Python-2.7.5.tgz
cd Python-2.7.5
make && make install
ln -s /usr/local/python2.7.5/bin/python /bin/python2.7.5
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar xzf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python2.7.5 setup.py build
python2.7.5 setup.py install
ln -s /usr/local/python2.7.5/bin/easy_install /bin/easy_install
easy_install MySQL-Python
python2.7.5
>>>

2. 源代码包方式安装MySQLdb(自带python版本)

cd ../
wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download
tar xzf MySQL-python-1.2.2.tar.gz
cd MySQL-python-1.2.2
python setup.py build
yum install python-devel #否则报错error: command 'gcc' failed with exit status 1
python setup.py install

文章来源:http://www.linuxeye.com/Linux/1789.html

  • 发表评论
  • 查看评论
【暂无评论!】

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。