Heim  >  Artikel  >  Datenbank  >  mysql-在MySQL中建表出现了错误,不会改。。。求帮忙,感谢

mysql-在MySQL中建表出现了错误,不会改。。。求帮忙,感谢

WBOY
WBOYOriginal
2016-06-06 09:43:391002Durchsuche

mysql

错误是这样的:
ERROR 1005 (HY000): Can't create table 'db_database25.tb_selldetail' (errno: 150
)

建表的步骤和内容如下:

DROP TABLE IF EXISTS tb_selldetail;

CREATE TABLE tb_selldetail (
id int(11) NOT NULL auto_increment,

sellName varchar(200) NOT NULL,

sellPrice double NOT NULL,
sellCount int(11) NOT NULL,

sellTime datetime NOT NULL,
medid int(11) default NULL,

userid int(11) default NULL,
PRIMARY KEY (id),

KEY FK56C63894822F277 (userid),

KEY FK56C63894DD16E7A7(medid),
CONSTRAINT FK56C63894822F277 FOREIGN KEY (userid) REFERENCES tb_user (id),

CONSTRAINT FK56C63894DD16E7A7 FOREIGN KEY (medid) REFERENCES tb_medicine (id)
)
ENGINE=InnoDB DEFAULT CHARSET=gbk;

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn