MySQL Workbench 中的正向工程 EER 图
使用 MySQL Workbench 5.2.33 和 MySQL 5.1.41
我创建了一个 EER 图。但是,当我尝试从 MySQL Workbench 对其进行正向工程时,出现以下错误:
Executing SQL script in server
ERROR: Error 1005: Can't create table 'test_db.test_table' (errno: 150)
-- -------------------------------------------------------
Table `test_db`.`test_table`
-- -------------------------------------------------------
CREATE TABLE IF NOT EXISTS `test_db`.`test_table` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`figure` TINYINT UNSIGNED NULL ,
`users_id` BIGINT UNSIGNED NOT NULL ,
`inactive` TINYINT(1) NULL ,
`type_id` TINYINT NOT NULL ,
PRIMARY KEY (`id`, `users_id`, `type_id`) ,
UNIQUE INDEX `id_UNIQUE` (`id` ASC) ,
INDEX `fk_figure_users1` (`users_id` ASC) ,
INDEX `fk_figure_type1` (`figure_type_id` ASC) ,
CONSTRAINT `fk_figure_users1`
FOREIGN KEY (`users_id` )
REFERENCES `test_db`.`users` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_figure_type1`
FOREIGN KEY (`type_id` )
REFERENCES `test_db`.`type` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
SQL script execution finished: statements: 9 succeeded, 1 failed
为什么会出现此错误?
Using MySQL Workbench 5.2.33 with MySQL 5.1.41
I have created an EER diagram. But when I try to forward engineer it from MySQL Workbench, I get the following error:
Executing SQL script in server
ERROR: Error 1005: Can't create table 'test_db.test_table' (errno: 150)
-- -------------------------------------------------------
Table `test_db`.`test_table`
-- -------------------------------------------------------
CREATE TABLE IF NOT EXISTS `test_db`.`test_table` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`figure` TINYINT UNSIGNED NULL ,
`users_id` BIGINT UNSIGNED NOT NULL ,
`inactive` TINYINT(1) NULL ,
`type_id` TINYINT NOT NULL ,
PRIMARY KEY (`id`, `users_id`, `type_id`) ,
UNIQUE INDEX `id_UNIQUE` (`id` ASC) ,
INDEX `fk_figure_users1` (`users_id` ASC) ,
INDEX `fk_figure_type1` (`figure_type_id` ASC) ,
CONSTRAINT `fk_figure_users1`
FOREIGN KEY (`users_id` )
REFERENCES `test_db`.`users` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_figure_type1`
FOREIGN KEY (`type_id` )
REFERENCES `test_db`.`type` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
SQL script execution finished: statements: 9 succeeded, 1 failed
Why am I getting this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://forums.mysql.com/read.php?22 ,19755,298807#msg-298807
你并不孤单......
http://forums.mysql.com/read.php?22,19755,298807#msg-298807
You are not alone....