作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
无法创建数据库
--------------------------------------------------------
create table DurableArticle(
durable_code varchar(30) not null,
durable_name varchar(100),
durable_number varchar(20),
durable_brandname varchar(125),
durable_modelordetail varchar(125),
durable_price varchar(20),
durable_entrance varchar(20),
constraint durable_PK primary key (durable_code)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
---------------------------------------------
create table DurableProfile(
profile_year integer not null,
profile_status varchar(100),
profile_note varchar(100),
staff_id integer not null,
owner_id integer not null,
room_id integer not null,
durable_code varchar(30) not null,
constraint profile_PK primary key (profile_year,durable_code),
constraint profile_FK1 foreign key (staff_id) references staff(staff_id),
constraint profile_FK2 foreign key (owner_id) references owner(owner_id),
constraint profile_FK3 foreign key (room_id) references room(room_id),
constraint profile_Fk4 foreign key (durable_code) references durablearticle (durable_code)
)ENGINE=InnoDB;
最佳答案
您在第二条语句中引用了 3 个表,这些表显然还不存在。删除外键或创建这些表,然后就可以了。
create table DurableProfile(
profile_year integer not null,
profile_status varchar(100),
profile_note varchar(100),
staff_id integer not null,
owner_id integer not null,
room_id integer not null,
durable_code varchar(30) not null,
constraint profile_PK primary key (profile_year,durable_code),
constraint profile_Fk4 foreign key (durable_code) references durablearticle (durable_code)
)ENGINE=InnoDB;
关于mysql - 错误代码: 1005 Can't create table 'custom_db2.durableprofile' (errno: 150),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25014220/
无法创建数据库 -------------------------------------------------------- create table DurableArticle( du
我是一名优秀的程序员,十分优秀!