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

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

WBOY
Release: 2016-06-06 09:43:39
Original
1053 people have browsed it

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;

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template