当前位置:网站首页>MySQL signale une erreur can 't create table' demo01. TB Étudiant '(errno: 150)
MySQL signale une erreur can 't create table' demo01. TB Étudiant '(errno: 150)
2022-07-01 19:40:00 【Désir et Yu Yu Yu】
mysql Erreur détectée lors de l'ajout d'une clé étrangère 150
Conseils:mysql Erreur détectée lors de l'ajout d'une clé étrangère ,Mais le type de clé étrangère est le même,Et ce champ existe dans une autre table
Contenu des erreurs signalées:Can’t create table ‘demo01.tb_Student’ (errno: 150)
Introduction à l'utilisation des clés étrangères:
CONSTRAINT Fk_Class_Student FOREIGN KEY(classId) references tb_class(classId)
CONSTRAINT Nom de la contrainte FOREIGN KEY(Nom de la clé étrangère) references Nom de la table à associer à la clé étrangère(Nom du champ)
CREATE TABLE tb_class(
classId int PRIMARY KEY AUTO_Increment,
ClassName varchar(20) not null
);
CREATE TABLE tb_Student(
StudentId int primary key Auto_increment,
StudentName varchar(20),
classId int not NULL,
CONSTRAINT Fk_Class_Student FOREIGN KEY(classId) references tb_class(classId)
)
Solutions:
Conseils:Création tb_StudentAjouter après ENGINE = MYISAM;
CREATE TABLE tb_class(
classId int PRIMARY KEY AUTO_Increment,
ClassName varchar(20) not null
);
CREATE TABLE tb_Student(
StudentId int primary key Auto_increment,
StudentName varchar(20),
classId int not NULL,
CONSTRAINT Fk_Class_Student FOREIGN KEY(classId) references tb_class(classId)
)ENGINE = MYISAM;
边栏推荐
- Introduction and installation of crunch, and making password dictionary with crunch
- GetMessage底层机制分析
- Download (export) PDF template file (such as approval form), and report error: invalid nested tag * * * found, expected closing tag***
- Witness the times! "The future of Renji collaboration has come" 2022 Hongji ecological partnership conference opens live broadcast reservation
- What is the essential difference between Bi development and report development?
- 直播HLS协议
- Why has instagram changed from a content sharing platform to a marketing tool? How do independent sellers use this tool?
- optaplanner学习笔记(一)案例Cloud balance
- Interview questions for audio and video positions in Dachang -- today's headline
- Nat penetration of gb28181
猜你喜欢

nacos启动失败问题解决与总结

How to correctly use vertx to operate redis (3.9.4 with source code analysis)

118. Yanghui triangle

What must be done in graduation season before going to Shanhai

EasyGBS网络不稳定情况下重复请求视频拉流问题的优化
![Thesis reading [distinctive late semantic graph for video capturing]](/img/d4/4f84a73a9127fa87bb0a74c4655d15.png)
Thesis reading [distinctive late semantic graph for video capturing]

Solidity - contract structure - error - ^0.8.4 NEW

GB28181之SIP协议

Interview questions for audio and video positions in Dachang -- today's headline

EasyGBS主子码流都为H.265时,切换出现花屏如何解决?
随机推荐
How to redraw the header of CListCtrl in MFC
Intensive cultivation of channels for joint development Fuxin and Weishi Jiajie held a new product training conference
Audio and video, encoding and decoding related e-books, gadgets, packaged for free!
微信小程序 navigator点击后有阴影 ,去掉navigator阴影效果
商业智能BI开发和报表开发有什么本质区别?
Basic knowledge of audio coding and decoding
【英语语法】Unit1 冠词、名词、代词和数词
wireshark报文分析tcp,ftp
GetMessage底层机制分析
狼人杀攻略:你当我好骗吗,我们相信谁!
axure不显示元件库
[go ~ 0 to 1] day 5 July 1 type alias, custom type, interface, package and initialization function
AAAI2020: Real-time Scene Text Detection with Differentiable Binarization
ubuntu14安装MySQL并配置root账户本地与远程访问
为什么一定要从DevOps走向BizDevOps?
【AI服务器搭建】CUDA环境
Interview question 16.16 Partial sorting - Double finger needling
OpenCV视频质量检测--清晰度检测
ffmpeg 错误码
Solidity - contract structure - error - ^0.8.4 NEW