关于mysql添加外键的时候报错_MySQL添加外键时报错:1215 Cannot add the foreign key constraint的一个可能解决方法...
今天给设计好的班级表和专业表以及院系表添加外键时,报了这样一个错误 **
1215 Cannot add the foreign key constraint
**
去百度搜了一圈,说可能时因为字段类型、长度不一致导致的,去检查了一下相应的数据表,发现相应的字段数据类型长度和数据数据引擎类型是一致的所以并不是这个问题
又去仔细找了一圈,发现了一个问题,发现喔设置外键的两张表排序规则不一样,哈哈哈,这个马虎眼打得
一个是utf8-unicode_ci,一个是utf8-general_ci,果不其然,问题就出在这,改成一样的排序规则就OK了
标题
关于mysql添加外键的时候报错_MySQL添加外键时报错:1215 Cannot add the foreign key constraint的一个可能解决方法...相关推荐
- mysql添加外键1215错误_MySQL添加外键时报错:1215 Cannot add the foreign key constraint的解决方法...
前言 这篇文章主要涉及到在数据创建表时,遇到ERROR 1215 (HY000): Cannot add foreign key constraint 问题方面的内容,对于在数据创建表时,遇到同样问题 ...
- Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
报错的原因大概分为三种: 原因一: 添加的外键列与另一个表的唯一索引列(一般是主键)的数据类型不同 原因二: 要添加外键的表类型与另一个表的存储引擎是不是都为innodb引擎 #查看表引擎 法一: s ...
- mysql删除有外链索引数据,Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法
mysql删除有外链索引数据,Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法 参考文章: (1 ...
- Mysql 建立外键出错1822 可能原因之一分析 - Failed to add the foreign key constraint. Missing index for constraint
项目场景: 通过sql语言在MySQL查询中建立表,其中一个表引用其他表的属性出现问题报错1822 问题描述 被引用的表--用户信息表: 可以看到其中已有主键s_id,为自增长形式 CREATE TA ...
- Mysql报错 Cannot delete or update a parent row: a foreign key constraint fails
mysql数据库中使用delete语句删除表中的一条信息时,报错:1451 - Cannot delete or update a parent row: a foreign key constrai ...
- 关于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..... 首先确定sql语句的正确 然后 ...
- mysql a foreign key constraint fails_外键记录有存在,插入数据却报错a foreign key constraint fails...
今天在MySQL的一张表里插记录时,出现一个错误提示: Cannot add or update a child row: a foreign key constraint fails (`jeesn ...
- mysql key constraint_MySQL/InnoDB的外键约束(Foreign Key Constraint)
MySQL/InnoDB的外键约束(Foreign Key Constraint) SQL外键约束 一个表中的 FOREIGN KEY 指向另一个表中的 PRIMARY KEY. FOREIGN KE ...
- mysql 1215_mysql执行带外键的sql文件时出现mysql ERROR 1215 (HY000): Cannot add foreign key constraint的解决...
ERROR 1215 (HY000): Cannot add foreign key constraint 最近在建表时遇到了这个错误,然后找了下找到了解决办法,记录下: 本来是要建两张表: 出现下面 ...
最新文章
- Scrum Master的成功定义是什么?
- python如何写生日快乐说说_高逼格祝福朋友生日快乐的说说
- WINCE6.0 + S3C2443的启动过程---nboot篇
- Error:java: 无效的标记 -version 编译错误的解决办法
- Git 实用操作 | 撤销 Commit 提交
- 读书,上学,上名校!!!!!
- Oracle备份如何到异机还原
- trunk口_Trunk的概念与设置
- 计算机网络自动分配ip地址,电脑如何设置自动获取ip地址?
- 机器学习不是你想用,想用就能用
- Akka 指南 之「集群分片」
- 2048总结 python_2048游戏的python实现
- scikit-learn广义线性模型之最小二乘法
- 记我的启蒙老师谢朝晖老师
- 【ubuntu】搭建lamp架构
- 望尽天涯路之从理财角度看高可用
- An attempt was made to call a method that does not exist. The attempt was ma
- 那一天我彻夜未眠,为CSDN收藏夹添加了搜索功能
- Android实现button一边圆角一边直角
- 在Android Studio中使用tess-Two