Home > Database > Mysql Tutorial > MySQL外键创建失败1005原因汇总_MySQL

MySQL外键创建失败1005原因汇总_MySQL

PHP中文网
Release: 2016-05-27 14:12:05
Original
2180 people have browsed it

MySQL外键创建失败1005原因汇总_MySQL

1、安装mysql有InnoDB的插件扩展

./configure --prefix=/usr/local/mysql --with-plugins=csv,innobase,myisam,heap,innodb_plugin
Copy after login

2、找不到主表中 引用的列
3、主键和外键的字符编码不一致
4、外键字段与要做外键校验的字段类型不匹配
5、MySQL支持外键约束,并提供与其它DB相同的功能,但表类型必须为 InnoDB,非InnoDB 存储引擎会导致报错。
6、建外键的表的那个列没有index。

以上就是MySQL外键创建失败1005原因汇总_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template