如何在django中连接mysql

hs1ihplo  于 2021-06-18  发布在  Mysql
关注(0)|答案(1)|浏览(327)

这个问题在这里已经有答案了

安装mysql python时“无法打开include文件:‘config win.h’:没有这样的文件或目录”(22个答案)
两年前关门了。
我正在尝试但没有连接,并在pip安装mysqlclient error_mysql.c(29): fatal error C1083: Cannot open include file: 'my_config.h': No such file or directory

zpqajqem

zpqajqem1#

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': '',
    }
}

相关问题