我有一个疑问,我在做什么毛病如下表声明:错误在MySQL上创建声明
的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;
我的怀疑来自于外键声明 – user2862454
你做一个搜索在Stackoverflow?似乎有几个职位关于错误150. – jcoppens