MySQL Forums
Forum List  »  InnoDB

Re: ERROR 1005: Can't create table (errno: 150) :: InnoDB
Posted by: Chris Moreland
Date: February 15, 2012 02:10PM

OK I have this same problem I cant seem to get going I have reviewed the Verysimple post on this and I am pretty sure I have everything correct however I seem to still get this error.. here is my full script any help would be GREATLY appreciated.Thanks in Advance

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

DROP SCHEMA IF EXISTS `silox` ;
CREATE SCHEMA IF NOT EXISTS `silox` DEFAULT CHARACTER SET utf8 ;
SHOW WARNINGS;
USE `silox` ;

-- -----------------------------------------------------
-- Table `silox`.`tbl_relate_feature`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `silox`.`tbl_relate_feature` ;

SHOW WARNINGS;
CREATE TABLE IF NOT EXISTS `silox`.`tbl_relate_feature` (
`idtbl_relate_feature` INT NOT NULL ,
`feature_id` INT NULL ,
`product_id` INT NULL ,
PRIMARY KEY (`idtbl_relate_feature`) )
ENGINE = InnoDB;

SHOW WARNINGS;

-- -----------------------------------------------------
-- Table `silox`.`tbl_relate_publisher`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `silox`.`tbl_relate_publisher` ;

SHOW WARNINGS;
CREATE TABLE IF NOT EXISTS `silox`.`tbl_relate_publisher` (
`idtbl_relate_publisher` INT NOT NULL ,
`publisher_id` INT NULL ,
`feature_id` INT NULL ,
PRIMARY KEY (`idtbl_relate_publisher`) )
ENGINE = InnoDB;

SHOW WARNINGS;

-- -----------------------------------------------------
-- Table `silox`.`tbl_feature`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `silox`.`tbl_feature` ;

SHOW WARNINGS;
CREATE TABLE IF NOT EXISTS `silox`.`tbl_feature` (
`feature_id` INT NOT NULL ,
`feature_name` VARCHAR(150) NULL ,
`feature_description` TEXT NULL ,
`feature_production` TEXT NULL ,
`feature_img` BLOB NULL ,
`feature_status` TINYINT(1) NULL ,
`feature_type` VARCHAR(45) NULL ,
`feature_custom` TINYINT(1) NULL ,
PRIMARY KEY (`feature_id`) ,
CONSTRAINT `fk_tbl_feature_tbl_relate_feature_1234`
FOREIGN KEY (`feature_id` )
REFERENCES `silox`.`tbl_relate_feature` (`feature_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_feature_tbl_relate_publisher_456`
FOREIGN KEY (`feature_id` )
REFERENCES `silox`.`tbl_relate_publisher` (`feature_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;

SHOW WARNINGS;

-- -----------------------------------------------------
-- Table `silox`.`tbl_relate_product`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `silox`.`tbl_relate_product` ;

SHOW WARNINGS;
CREATE TABLE IF NOT EXISTS `silox`.`tbl_relate_product` (
`idtbl_relate_product` INT NOT NULL ,
`publisher_id` INT NULL ,
`product_id` INT NULL ,
PRIMARY KEY (`idtbl_relate_product`) )
ENGINE = InnoDB;

SHOW WARNINGS;

-- -----------------------------------------------------
-- Table `silox`.`tbl_publisher`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `silox`.`tbl_publisher` ;

SHOW WARNINGS;
CREATE TABLE IF NOT EXISTS `silox`.`tbl_publisher` (
`publisher_id` INT NOT NULL ,
`publisher_notes` TEXT NULL ,
`publisher_name` VARCHAR(150) NULL ,
`publisher_address` VARCHAR(150) NULL ,
`publisher_phone` VARCHAR(45) NULL ,
`publisher_custom` TINYINT(1) NULL ,
`publisher_url` VARCHAR(250) NULL ,
PRIMARY KEY (`publisher_id`) ,
CONSTRAINT `fk_tbl_publisher_tbl_relate_product12222`
FOREIGN KEY (`publisher_id` )
REFERENCES `silox`.`tbl_relate_product` (`publisher_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_publisher_tbl_relate_publisher1222`
FOREIGN KEY (`publisher_id` )
REFERENCES `silox`.`tbl_relate_publisher` (`publisher_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;

SHOW WARNINGS;

-- -----------------------------------------------------
-- Table `silox`.`tbl_product`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `silox`.`tbl_product` ;

SHOW WARNINGS;
CREATE TABLE IF NOT EXISTS `silox`.`tbl_product` (
`product_id` INT NOT NULL ,
`product_name` VARCHAR(150) NULL ,
`product_description` TEXT NULL ,
`product_silo` VARCHAR(45) NULL ,
PRIMARY KEY (`product_id`) ,
CONSTRAINT `fk_tbl_product_tbl_relate_feature1`
FOREIGN KEY (`product_id` )
REFERENCES `silox`.`tbl_relate_feature` (`product_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_product_tbl_relate_product1`
FOREIGN KEY (`product_id` )
REFERENCES `silox`.`tbl_relate_product` (`product_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;

SHOW WARNINGS;


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

Options: ReplyQuote


Subject
Views
Written By
Posted
649404
March 24, 2005 01:20PM
5543
October 09, 2012 09:48PM
3741
December 19, 2011 10:13PM
9269
May 09, 2006 06:01PM
8406
November 15, 2006 02:05PM
Re: ERROR 1005: Can't create table (errno: 150) :: InnoDB
2382
February 15, 2012 02:10PM
7425
T D
February 01, 2008 06:47AM
9266
August 27, 2008 08:08AM
9784
December 03, 2008 10:15AM
6254
May 01, 2009 07:39AM
3503
August 29, 2011 04:46PM
5102
s l
December 15, 2009 01:48PM
5020
December 22, 2009 02:54AM
3268
February 18, 2011 08:55AM
3944
May 24, 2011 10:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.