当前位置:网站首页>Error1822 and error1824 are displayed in the database
Error1822 and error1824 are displayed in the database
2022-06-25 13:36:00 【CSDN Q & A】
Display when running order Where? ERROR 1822 : Failed to add the foreign key constraint. Missing index for constraint ‘orderitem_ibfk_1’ in the referenced table ‘orders’, I did some research on the Internet , See that you want to check whether the foreign key is the primary key of another table , But they are all , What's going on
I put it back order Table commented out , Show c_sevice That watch ERROR 1824 : Failed to open the referenced table 'fastfood_shop' What's going on
CREATE TABLE admin_login(admin_id varchar(50) NOT NULL,admin_pass varchar(50) DEFAULT NULL,
PRIMARY KEY (admin_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE order1(cons_phone varchar(50) NOT NULL,service_id varchar(50) NOT NULL,order_id varchar(50) NOT NULL,forder_money varchar(50) DEFAULT NULL,order_way varchar(50) DEFAULT NULL,cons_name varchar(50) DEFAULT NULL,cons_addre varchar(50) NOT NULL,
PRIMARY KEY (cons_phone,service_id),
FOREIGN KEY (cons_phone) REFERENCES order1 (cons_phone),
FOREIGN KEY (service_id) REFERENCES c_service (c_service_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE c_service(c_service_id varchar(50) NOT NULL,c_service_name varchar(50) NOT NULL,fastfood_shop_name varchar(50) NOT NULL,
PRIMARY KEY (c_service_id),
FOREIGN KEY (fastfood_shop_name) REFERENCES fastfood_shop(shop_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE fastfood_shop(shop_name varchar(50) NOT NULL,m_sale_v varchar(50) NOT NULL,
PRIMARY KEY (shop_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE dispatcher(dispatcher_id varchar(50) NOT NULL,dispatcher_name varchar(50) NOT NULL,dispatcher_phone varchar(50) NOT NULL,fastfood_shop_namel varchar(50) NOT NULL,
PRIMARY KEY (dispatcher_id),
FOREIGN KEY (fastfood_shop_namel) REFERENCES fastfood_shop(shop_name)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE wuliu(cons_phonel varchar(50) NOT NULL,disp_id varchar(50) NOT NULL,deliver_time varchar(50) DEFAULT NULL,
PRIMARY KEY (cons_phonel,disp_id),
FOREIGN KEY (cons_phonel) REFERENCES order1(cons_phone),
FOREIGN KEY (disp_id) REFERENCES dispatcher(dispatcher_id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
边栏推荐
- 數據在內存中的存儲相關內容
- JS prototype. slice. call(arguments); Convert pseudo array to array
- OpenStack学习笔记之-Nova组件深入了解
- 三行代码简单修改jar包的项目代码
- Nova中的api
- Openstack -- creating virtual machines for Nova source code analysis
- Cesium--- figure loading
- Rust, the best choice for programmers to start a business?
- Parabolic motion in unity 2D games
- Sword finger offer day 1 stack and queue (simple)
猜你喜欢

À propos du stockage des données en mémoire

一篇文章讲清楚MySQL的聚簇/联合/覆盖索引、回表、索引下推

Summer Ending
![leetcode:456. 132 mode [monotone stack]](/img/fa/44a5194b244f30383409ef40966453.png)
leetcode:456. 132 mode [monotone stack]

KDD 2022 | graphmae: self supervised mask map self encoder

How to determine if a web worker has been created or closed

Sword finger offer day 2 linked list (simple)

Some knowledge of the initial C language

Sword finger offer II 032 Effective anagrams

Drago Education - typescript learning
随机推荐
Sword finger offer II 025 Adding two numbers in a linked list
【Proteus仿真】51单片机+DS1302+lcd1602显示
MySQL learning notes
Uncover gaussdb (for redis): comprehensive comparison of CODIS
Germany holds global food security Solidarity Conference
Stockage des données en mémoire
一篇文章讲清楚MySQL的聚簇/联合/覆盖索引、回表、索引下推
Sword finger offer day 1 stack and queue (simple)
Summary of leetcode linked list problem solving skills
坡道带来的困惑
关于一道教材题的讲解
[pit avoidance refers to "difficult"] antd cascader implements new customized functions
Confusion caused by the ramp
Use of bind() in JS and handwritten bind()
[data visualization] antv L7 realizes map visualization, drilldownlayer drill asynchronously obtains data, and suspends the warning box
OpenStack学习笔记(二)
Discuz仿今日头条模板/Discuz新闻资讯商业版GBK模板
leetcode:918. 环形子数组的最大和【逆向思维 + 最大子数组和】
C# 切换中英文输入法
历史上的今天:网易成立;首届消费电子展召开;世界上第一次网络直播