【error】django.db.utils.OperationalError: (1193, "Unknown system variable 'storage_engine'")
程序员文章站
2022-05-19 22:10:23
...
当我们连接数据库时,有需要自定义option,可以用字典的形式
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add
'NAME': 'am', # Or path to database file if using sqlite3.
'USER': 'probe', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '3306', # Set to empty string for default. Not used with sqlite3.
'OPTIONS': {
'init_command': 'SET storage_engine=INNODB',
},
},
}
但是,有时候我们会遇到如下错误
django.db.utils.OperationalError: (1193, "Unknown system variable 'storage_engine'")
需要把
"OPTIONS":{"init_command":"SET storage_engine=INNODB;"}
改成
"OPTIONS":{"init_command":"SET default_storage_engine=INNODB;"}
问题是mysql版本导致的!
上一篇: PHP中csv导出三个月内的数据解决方案
下一篇: 第一天的MarkDown语法
推荐阅读
-
Mysql5.7修改用户密码,报错“Unknown trigger has an error in its body: ‘Unknown system variable ‘maintain_user”
-
[MySQL参数取值] Status取值ERROR 1193 (HY000): Unknown system_MySQL
-
django.db.utils.OperationalError: (1193, "Unknown system variable 'storage_engine'")
-
django.db.utils.OperationalError: (1193, "Unknown system variable 'storage_engine'")
-
django.db.utils.OperationalError: (1193, "Unknown system variable 'storage_engine'")
-
django.db.utils.OperationalError: (1193, "Unknown system variable 'storage_engine'")解决办法
-
【error】django.db.utils.OperationalError: (1193, "Unknown system variable 'storage_engine'")
-
django.db.utils.OperationalError: (1193, "Unknown system variable 'storage_engine'")
-
django.db.utils.OperationalError: (1193, "Unknown system variable 'storage_engine'")
-
Django:报错django.db.utils.OperationalError: (1193, "Unknown system variable 'storage_engine'")解决方案