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

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

PHP中文网
PHP中文网Original
2016-05-27 14:12:052059browse

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

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

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

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

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


Statement:
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