Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql无法识别为内部或外部命令_Mysql_Django - Fatal编程技术网

Mysql无法识别为内部或外部命令

Mysql无法识别为内部或外部命令,mysql,django,Mysql,Django,我试图用我的Django项目ecomstore配置mysql,我得到标题中给出的错误 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # 'NAME': 'ecomstore', # Or path to database file if using sqlite3. 'USER': 'root',

我试图用我的Django项目ecomstore配置mysql,我得到标题中给出的错误

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', # 
        'NAME': 'ecomstore',                      # Or path to database file if using sqlite3.
        'USER': 'root',                      # Not used with sqlite3.
        'PASSWORD': 'password',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}
错误:

C:\Python27\Djangoprojects\ecomstore>python manage.py dbshell
'mysql' is not recognized as an internal or external command,
operable program or batch file.

请提供您的输入。

只需使用
'ENGINE':'mysql',
。我当前的应用程序就是这样的。

这仅仅意味着“mysql”可执行命令文件(mysql.exe)没有添加到您的系统路径,因此系统无法找到该文件。要将“mysql”添加到系统路径,请尝试定位“mysql”常驻文件夹

似乎您正在使用windows,以下是步骤:

1) 转到控制面板->系统和安全->系统


2) 粘贴“mysql常驻文件夹路径”进入变量值:编辑系统变量的字段弹出。

python manage.py dbshell
只是mysql-d DATABASENAME-u USERNAME-p PASSWORD的快捷方式,您需要在系统上安装mysql,并且mysql命令应该能够从控制台运行。

可以通过shellIts访问mysql与其说是django问题,不如说是mysql问题……我要重新标记它