IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constrai nt fails (`mxonline
来源:互联网 发布:淘宝网如何绑定银行卡 编辑:程序博客网 时间:2024/06/04 18:49
IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`mxonline`.`django_admin_log`, CONSTRAINT `django_admin_log_user_id_c564eba6_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`))')
解决方案
settings.py
中
增加
'OPTIONS': { "init_command": "SET foreign_key_checks = 0;", }
修改成
# Database# https://docs.djangoproject.com/en/1.9/ref/settings/#databasesDATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'mxonline', 'USER': 'root', 'PASSWORD': 'root', 'HOST': '127.0.0.1', 'OPTIONS': { "init_command": "SET foreign_key_checks = 0;", } }}
阅读全文
0 0
- IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constrai nt fails (`mxonline
- django admin报错IntegrityError:'Cannot add or update a child row: a foreign key constraint fails'
- Mysql error 1452 - Cannot add or update a child row: a foreign key constraint fails
- Mysql error 1452 - Cannot add or update a child row: a foreign key constraint fails
- 1452, 'Cannot add or update a child row: a foreign key constraint fails
- Cannot add or update a child row: a foreign key constraint fails (`mysql`.`ordermx`, CONSTRAINT `kf
- Cannot add or update a child row: a foreign key constraint fails
- mysql Cannot add or update a child row: a foreign key constraint fails
- Cannot add or update a child row: a foreign key constraint fails (`tsproduct/product`, CONSTRAINT `F
- Cannot add or update a child row: a foreign key constraint fails 解决办法
- Cannot add or update a child row: a foreign key constraint fails 问题的处理
- Error 'Cannot add or update a child row: a foreign key constraint fails
- Cannot add or update a child row: a foreign key constraint fails 无法添加外键
- mysql添加外键失败:sql 1452 Cannot add or update a child row:a foreign key constraint fails
- mysql添加外键失败:sql 1452 Cannot add or update a child row:a foreign key constraint fails
- Mysql添加数据时失败 Cannot add or update a child row: a foreign key constraint fails
- [Mysql] 添加外键失败:Cannot add or update a child row:a foreign key constraint fails
- MySql外键添加失败:java.ql.SQLException: Cannot add or update a child row: a foreign key constraint fails
- Django1.9.8项目配置
- Android之面试常见问题
- bat批处理的注释语句
- 报错: reason: 'data parameter is nil' 本地JSON文件找不到
- 将本地项目提交github
- IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constrai nt fails (`mxonline
- HAOI2010 计数
- 巴什博弈
- localStorage总结
- js判断数字是否为整数
- android 开机流程详细分析
- 神创造了致病的病毒吗?
- android aspectj 配置
- 字符串去除空格回车以及随机生成中英文字符串