mysql建立外键出错,求原因及解决方法 img=http://][/img]我按照图中的scheme建立表,红色方框这个地方的外键约束添加就出错,大神教我怎么解决mysqlscheme外键 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 贴出你的 show create table 语句和错误信息。 我已经解决了,应该是因为在建contact_interest和contact_seeking两表时contact_id的外键约束名一样,create table contact_interest(contact_id int not null,interest_id int not null,primary key(contact_id,interest_id),constraint my_contacts_contact_id_fkforeign key(contact_id)references my_contacts(contact_id),constraint interests_interest_id_fkforeign key(interest_id)references interests(interest_id));create table contact_seeking(contact_id int not null,seeking_id int not null,primary key(contact_id,seeking_id),constraint my_contacts_contact_id_fkforeign key(contact_id)references my_contacts(contact_id),constraint seeking_seeking_id_fkforeign key(seeking_id)references seeking(seeking_id));这是错误原因吧!我的建表语句还有没有其他问题? 版主大人!!救救我啊!!! mysql存储过程如何判断dml和dql执行的状态 SQL多表查询语句,速度奇慢无比 请教mysqldump的时间问题 如何进行Mysql备份和还原? 请问怎么把一段格式化的文字存入mysql中,而拿出来的时候格式没有变?? mysql 中如何添加一个用户 linux 系统装apache+mysql+php怪问题 确实很怪 mysql数据库做双机热备遇到点问题,求高手指点 求助,sql执行顺序,having中的聚合函数基于哪个虚拟表 select语句问题, 怎样将两个表内相同的列生成一个表内? ubuntu下启动mysql
(
contact_id int not null,
interest_id int not null,
primary key(contact_id,interest_id),
constraint my_contacts_contact_id_fk
foreign key(contact_id)
references my_contacts(contact_id),
constraint interests_interest_id_fk
foreign key(interest_id)
references interests(interest_id)
);create table contact_seeking
(
contact_id int not null,
seeking_id int not null,
primary key(contact_id,seeking_id),
constraint my_contacts_contact_id_fk
foreign key(contact_id)
references my_contacts(contact_id),
constraint seeking_seeking_id_fk
foreign key(seeking_id)
references seeking(seeking_id)
);
这是错误原因吧!我的建表语句还有没有其他问题?