1. 安装Python-setuptools
复制代码
1
2
3
4
5
6wget --no-cookie --no-check-certificate http://pypi.python.org/packages/source/s/setuptools/setuptools-3.4.4.tar.gz #(上面由于使用了https和ssl的原因,需要使用上面两个参数,否则不能下载,将会提示"Unable to establish SSl connection") tar xzvf setuptools-3.4.4.tar.gz cd setuptools-3.4.4 python setup.py build python setup.py install
2.安装 python-devel
http://rpmfind.net/linux/rpm2html/search.php?query=python-devel( 下载对应版本)
3. 安装 MySQL-python
如果出现:
Error: python-devel conflicts with python ?
Please try --
yum clean all
yum install yum-utils
yum-complete-transaction
yum update
复制代码
1wget--no-check-certificate https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.4b5.tar.gz
4. django 测试
复制代码
1
2
3
4
5
6
7
8
9
10
11
12# settings.py # Database # https://docs.djangoproject.com/en/1.6/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'test01', 'USER': 'root', 'PASSWORD': '', 'HOST': '127.0.0.1' } }
复制代码
1python manage.py syncdb
复制代码
1
2
3
4
5
6
7
8
9[root@linux-ke test01]# python manage.py runserver 0.0.0.0:8000 Validating models... 0 errors found April 20, 2014 - 09:47:35 Django version 1.6.2, using settings 'test01.settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C. [20/Apr/2014 09:47:42] "GET / HTTP/1.1" 200 1757 [20/Apr/2014 09:47:44] "GET / HTTP/1.1" 200 1757
转载于:https://blog.51cto.com/zunfengke/1398879
最后
以上就是碧蓝外套最近收集整理的关于MySQL-Python 安装的全部内容,更多相关MySQL-Python内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复