Centos环境下MySQL-python安装过程
2012-06-05 11:43
896 查看
1. 下载 MySQL-python-1.2.3.tar.gz
地址 https://sourceforge.net/projects/mysql-python/
2. 安装 MySQl-python
tar xvf MySQL-python-1.2.3.tar.gz
cd MySQL-python-1.2.3
vi site.cfg
把 mysql_config = /usr/local/mysql/bin/mysql_config 这一行前的#去掉,并且把mysql_config的路径设置正确。
python setup.py build
运行上面的命令报错如下:
解决方法:
继续安装:
运行测试:
报出一大堆警告信息,解决办法:删除MySQL-python源目录,再测试一下:
Mysql模块终于正常了!
地址 https://sourceforge.net/projects/mysql-python/
2. 安装 MySQl-python
tar xvf MySQL-python-1.2.3.tar.gz
cd MySQL-python-1.2.3
vi site.cfg
把 mysql_config = /usr/local/mysql/bin/mysql_config 这一行前的#去掉,并且把mysql_config的路径设置正确。
python setup.py build
运行上面的命令报错如下:
[root@localhost MySQL-python-1.2.3]# python setup.py install Traceback (most recent call last): File "setup.py", line 5, in ? from setuptools import setup, Extension ImportError: No module named setuptools |
wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz tar zxvf setuptools-0.6c11.tar.gz cd setuptools-0.6c11 python setup.py build python setup.py install |
python setup.py build python setup.py install |
[root@localhost MySQL-python-1.2.3]# python Python 2.4.3 (#1, Sep 3 2009, 15:37:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import MySQLdb /usr/lib64/python2.4/site-packages/MySQL_python-1.2.3-py2.4-linux-x86_64.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/lib64/python2.4/site-packages/MySQL_python-1.2.3-py2.4-linux-x86_64.egg/_mysql.pyc, but /opt/python/MySQL-python-1.2.3 is being added to sys.path >>> |
[root@localhost python]# python Python 2.4.3 (#1, Sep 3 2009, 15:37:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import MySQLdb >>> |
相关文章推荐
- Centos环境下MySQL-python安装过程
- Linux环境下MySQL-python安装过程
- CentOS上安装LAMP之MySQL环境及安装过程报错解决方案(纯净系统环境)
- centos64位 安装python mysql-client环境
- Linux环境下MySQL-python安装过程
- CentOS 7安装Python3.6过程(让linux系统共存Python2和Python3环境)
- Centos6.7下安装python连接mysql环境故障解决
- Linux环境下MySQL-python安装过程
- Linux环境下MySQL-python安装过程分享
- centos6.5上安装nginx+python+mysql+ uwsgi开发环境
- CentOS6.5上python-mysql环境的安装问题解决
- CentOS 7安装Python3.6过程(让linux系统共存Python2和Python3环境)
- Linux环境下MySQL-python安装过程
- Linux环境下MySQL-python安装过程
- Linux环境下MySQL-python安装过程分享
- linux环境CentOS-->mysql安装和删除
- ubuntu环境下python虚拟环境的安装过程
- CentOS 6.3下源码安装LAMP(Linux+Apache+Mysql+Php)环境
- 记录一次CentOS环境升级Python2.6到Python2.7并安装最新版pip
- Windows虚拟环境下安装mysql-python