【发布时间】:2015-09-14 17:14:26
【问题描述】:
我怀疑我在下面的表格语句中做错了什么:
MySQL 返回错误 150
DROP table usuario;
DROP table MiTabla;
CREATE TABLE usuario(
id smallint unsigned auto_increment primary key,
name varchar(20) not null
)ENGINE=InnoDB;
Insert into usuario (NAME) VALUES ('Antonio'),('Jose'),('Manuel');
CREATE TABLE MiTabla(
id smallint unsigned auto_increment primary key,
name varchar(20) not null,
foreign key (name) REFERENCES usuario (name)
) ENGINE = InnoDB;
【问题讨论】:
-
我的怀疑来自外键声明
-
你在 Stackoverflow 上搜索过吗?似乎有几篇关于错误 150 的帖子。
标签: mysql ddl mysql-error-150