SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error 1005: Can't create table (errno: 121)

    Hi, I'v been looking around for my problem but still cant find it, I'm new to mySQL. I keep getting this error. Please help
    Thank You

    Code MySQL:
    ERROR: Error 1005: Can't create table '.\san10117028r\quoteproduct.frm' (errno: 121)
     
     
     
     
     
     
     
    -- -----------------------------------------------------
     
    -- Table `san10117028r`.`QuoteProduct`
     
    -- -----------------------------------------------------
     
    CREATE  TABLE IF NOT EXISTS `san10117028r`.`QuoteProduct` (
     
      `ProductID` INT NOT NULL ,
     
      `Quantity` VARCHAR(45) NULL ,
     
      `Comments` VARCHAR(45) NULL ,
     
      `QuoteID` INT NOT NULL ,
     
      INDEX `ProductID` (`ProductID` ASC) ,
     
      INDEX `QuoteID` (`QuoteID` ASC) ,
     
      PRIMARY KEY (`ProductID`) ,
     
      CONSTRAINT `ProductID`
     
        FOREIGN KEY (`ProductID` )
     
        REFERENCES `san10117028r`.`Products` (`ProductID` )
     
        ON DELETE CASCADE
     
        ON UPDATE CASCADE,
     
      CONSTRAINT `QuoteID`
     
        FOREIGN KEY (`QuoteID` )
     
        REFERENCES `san10117028r`.`QuoteSummery` (`QuoteID` )
     
        ON DELETE CASCADE
     
        ON UPDATE CASCADE)
     
    ENGINE = InnoDB

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    post your create table statements for the two tables you reference in your foreign keys. that might offer a clue.

  3. #3
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guelphdad View Post
    post your create table statements for the two tables you reference in your foreign keys. that might offer a clue.
    Code MySQL:
    -- -----------------------------------------------------
     
    -- Table `san10117028r`.`Products`
     
    -- -----------------------------------------------------
     
    CREATE  TABLE IF NOT EXISTS `san10117028r`.`Products` (
     
      `ProductID` INT NOT NULL ,
     
      `EnvelopeID` INT NULL ,
     
      `BasketID` INT NULL ,
     
      `BurnerID` INT NULL ,
     
      `FuelCylinderID` INT NULL ,
     
      `AccessoriesID` INT NULL ,
     
      `FanID` INT NULL ,
     
      PRIMARY KEY (`ProductID`) ,
     
      INDEX `EnvelopeID` (`EnvelopeID` ASC) ,
     
      INDEX `BasketID` (`BasketID` ASC) ,
     
      INDEX `BurnerID` (`BurnerID` ASC) ,
     
      INDEX `FuelCylinderID` (`FuelCylinderID` ASC) ,
     
      INDEX `AccessoriesID` (`AccessoriesID` ASC) ,
     
      INDEX `FanID` (`FanID` ASC) ,
     
      CONSTRAINT `EnvelopeID`
     
        FOREIGN KEY (`EnvelopeID` )
     
        REFERENCES `san10117028r`.`Envelope` (`EnvelopeID` )
     
        ON DELETE CASCADE
     
        ON UPDATE CASCADE,
     
      CONSTRAINT `BasketID`
     
        FOREIGN KEY (`BasketID` )
     
        REFERENCES `san10117028r`.`Basket` (`BasketID` )
     
        ON DELETE CASCADE
     
        ON UPDATE CASCADE,
     
      CONSTRAINT `BurnerID`
     
        FOREIGN KEY (`BurnerID` )
     
        REFERENCES `san10117028r`.`Burner` (`BurnerID` )
     
        ON DELETE CASCADE
     
        ON UPDATE CASCADE,
     
      CONSTRAINT `FuelCylinderID`
     
        FOREIGN KEY (`FuelCylinderID` )
     
        REFERENCES `san10117028r`.`FuelCylinder` (`FuelCylinderID` )
     
        ON DELETE CASCADE
     
        ON UPDATE CASCADE,
     
      CONSTRAINT `AccessoriesID`
     
        FOREIGN KEY (`AccessoriesID` )
     
        REFERENCES `san10117028r`.`Accessories` (`AccessoriesID` )
     
        ON DELETE CASCADE
     
        ON UPDATE CASCADE,
     
      CONSTRAINT `FanID`
     
        FOREIGN KEY (`FanID` )
     
        REFERENCES `san10117028r`.`Fans` (`FanID` )
     
        ON DELETE CASCADE
     
        ON UPDATE CASCADE)
     
    ENGINE = InnoDB;
     
     
    -- -----------------------------------------------------
     
    -- Table `san10117028r`.`QuoteSummery`
     
    -- -----------------------------------------------------
     
    CREATE  TABLE IF NOT EXISTS `san10117028r`.`QuoteSummery` (
     
      `QuoteID` INT NOT NULL ,
     
      `ClientID` INT NOT NULL ,
     
      `BalloonName` VARCHAR(45) NULL ,
     
      `Country` VARCHAR(45) NULL ,
     
      `EnquiredDate` VARCHAR(45) NULL ,
     
      `QuoteStatus` VARCHAR(45) NULL ,
     
      `Deadline` VARCHAR(45) NULL ,
     
      `StaffID` INT NOT NULL ,
     
      `LastEdited` VARCHAR(45) NULL ,
     
      PRIMARY KEY (`QuoteID`) ,
     
      INDEX `ClientID` (`ClientID` ASC) ,
     
      INDEX `StaffID` (`StaffID` ASC) ,
     
      CONSTRAINT `ClientID`
     
        FOREIGN KEY (`ClientID` )
     
        REFERENCES `san10117028r`.`ClientDetails` (`ClientID` )
     
        ON DELETE CASCADE
     
        ON UPDATE CASCADE,
     
      CONSTRAINT `StaffID`
     
        FOREIGN KEY (`StaffID` )
     
        REFERENCES `san10117028r`.`Staff` (`StaffID` )
     
        ON DELETE CASCADE
     
        ON UPDATE CASCADE)
     
    ENGINE = InnoDB;

    There are the table statements for the two tables i referenced.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •