title: ERROR: Error 1005: Can't create table (errno: 150)
body: <p>Long time user, first time poster.</p>
  
  <p>I am TRYING to create a database for a university assignment and am getting the above error code 
  (ERROR: Error 1005: Can't create table 'mydb.songs' (errno: 150))</p>
  
  <p>I have checked to see all fk's and Pk's are the same. All tables should also be of the same type.</p>
  
  <p>Can anyone help?</p>
  
  <p>Thanks</p>
  
  <blockquote>
    <p>Executing SQL script in server ERROR: Error 1005: Can't create table
    'mydb.songs' (errno: 150)</p>
  </blockquote>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `mydb`.`Songs` (
    `SongId` INT NOT NULL,
    `SongTitle` VARCHAR(45) NULL,
    `SongLength` VARCHAR(45) NULL,
    `ProductionDate` VARCHAR(45) NULL,
    `Author` VARCHAR(45) NULL,
    `Price` VARCHAR(45) NULL,
    `AuthorId` INT NULL,
    `Musicians_MusicianId` INT NOT NULL,
    `Instruments_InstrumentId` INT NOT NULL,
    `MediaFiles_MediaId` INT NOT NULL,
    PRIMARY KEY (`SongId`, `Musicians_MusicianId`, `Instruments_InstrumentId`, `MediaFiles_MediaId`),
    INDEX `fk_Songs_Musicians1_idx` (`Musicians_MusicianId` ASC),
    INDEX `fk_Songs_Instruments1_idx` (`Instruments_InstrumentId` ASC),
    INDEX `fk_Songs_MediaFiles1_idx` (`MediaFiles_MediaId` ASC),
    CONSTRAINT `fk_Songs_Musicians1`
      FOREIGN KEY (`Musicians_MusicianId`)
      REFERENCES `mydb`.`Musicians` (`MusicianId`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Songs_Instruments1`
      FOREIGN KEY (`Instruments_InstrumentId`)
      REFERENCES `mydb`.`Instruments` (`InstrumentId`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION,
    CONSTRAINT `fk_Songs_MediaFiles1`
      FOREIGN KEY (`MediaFiles_MediaId`)
      REFERENCES `mydb`.`MediaFiles` (`MediaId`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB
  </code></pre>
  
  <p>SQL script execution finished: statements: 18 succeeded, 1 failed</p>
  
  <p>Fetching back view definitions in final form.
  Nothing to fetch</p>