首頁  >  文章  >  資料庫  >  centos和ubuntu下安装mysql for django出现的问题

centos和ubuntu下安装mysql for django出现的问题

WBOY
WBOY原創
2016-06-07 15:39:52910瀏覽

命令为easy_install MySQL-python 首先是“error: Setup script exited with error: command 'gcc' failed with exit status 1” 具体原因是没有安装python-dev 但是在centos下python-dev的名字为python-devel 安装后即可成功安装 django setting.py文件中数

命令为easy_install MySQL-python

首先是“error: Setup script exited with error: command 'gcc' failed with exit status 1”

具体原因是没有安装python-dev

但是在centos下python-dev的名字为python-devel

安装后即可成功安装


django setting.py文件中数据库配置为

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME':   'db_name',
        'USER' :  'root',
        'PASSWORD':'password',
        'HOST'    :'localhost',
    }
}


陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn