【问题标题】:How to connect the mysql in django [duplicate]如何在django中连接mysql [重复]
【发布时间】:2019-03-27 17:03:10
【问题描述】:

我正在尝试但未连接,并在 pip install mysqlclient 中安装得到error_mysql.c(29): fatal error C1083: Cannot open include file: 'my_config.h': No such file or directory

【问题讨论】:

  • 欢迎来到 Stack Overflow!为了给您一个很好的答案,如果您还没有看过How to Ask,它可能会对我们有所帮助。如果您可以提供minimal reproducible example,它可能也很有用。

标签: python mysql django python-3.x


【解决方案1】:
you will configure your Django app to connect to MySQL. You will need to change the DATABASES dictionary to something along these lines:

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

【讨论】:

  • 我正在使用 Windows 7,我正在安装 pip install mysqlclient 它得到错误先生
猜你喜欢
  • 2017-02-06
  • 1970-01-01
  • 1970-01-01
  • 2012-01-12
  • 1970-01-01
  • 2020-10-27
  • 1970-01-01
  • 2015-07-02
  • 2011-05-30
相关资源
最近更新 更多