MYSQL脚本错误:121

时间:2014-09-18 06:54:55

标签: mysql mysql-workbench

所以我正在使用workbench来转发我创建的一些表,我使用mysql的新表,我在查找代码中的错误时遇到了问题

Executing SQL script in server
ERROR: Error 1005: Can't create table 'mydb.pisubclass' (errno: 121)
 SQL Code:
    -- -----------------------------------------------------
    -- Table `mydb`.`PISubclass`
    -- -----------------------------------------------------
    CREATE TABLE IF NOT EXISTS `mydb`.`PISubclass` (
      `PISubID` INT NOT NULL,
      `PIID` INT NOT NULL,
      `FAID` INT NOT NULL,
      `description` VARCHAR(45) NULL,
      INDEX `PIID_idx` (`PIID` ASC),
      INDEX `FAID_idx` (`FAID` ASC),
      CONSTRAINT `PIID`
        FOREIGN KEY (`PIID`)
        REFERENCES `mydb`.`PolicyIndicators` (`PIID`)
        ON DELETE NO ACTION
        ON UPDATE NO ACTION,
      CONSTRAINT `FAID`
        FOREIGN KEY (`FAID`)
        REFERENCES `mydb`.`PolicyIndicators` (`FAID`)
        ON DELETE NO ACTION
        ON UPDATE NO ACTION)
    ENGINE = InnoDB

 SQL script execution finished: statements: 9 succeeded, 1 failed

 Fetching back view definitions in final form.
 Nothing to fetch

谢谢:)!

0 个答案:

没有答案