MySQL Forums
Forum List  »  Portuguese

Erro ao criar tabela no MySQL
Posted by: Paulo Reis
Date: September 11, 2009 11:49AM

Não conseguindo criar umas tabelas no MySQL pois esta dando um erro.

Olha os creates:

CREATE TABLE IF NOT EXISTS `intercede`.`user` (
`id` INT NOT NULL AUTO_INCREMENT ,
`registered_on` DATETIME NOT NULL ,
`updated_on` DATETIME NOT NULL ,
`last_log` DATETIME NOT NULL ,
`firstname` VARCHAR(20) NOT NULL ,
`lastname` VARCHAR(20) NOT NULL ,
`birth` DATE NULL ,
`email` VARCHAR(70) NOT NULL ,
`login` VARCHAR(45) NOT NULL ,
`password` CHAR(32) NOT NULL ,
`verified` TINYINT(1) NOT NULL DEFAULT 0 ,
`blocked` TINYINT(1) NOT NULL DEFAULT 0 ,
PRIMARY KEY (`id`) ,
UNIQUE INDEX `unique_user` (`email` ASC, `login` ASC) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `intercede`.`intercession` (
`id` INT NOT NULL AUTO_INCREMENT ,
`generated_on` DATETIME NOT NULL ,
`from_user_id` INT NOT NULL ,
`to_user_id` INT NOT NULL ,
`week` INT(2) NOT NULL ,
`year` YEAR NOT NULL ,
`from_allow_dialog` TINYINT(1) NOT NULL DEFAULT 1 ,
`to_allow_dialog` TINYINT(1) NOT NULL DEFAULT 1 ,
PRIMARY KEY (`id`) ,
UNIQUE INDEX `unique_intercession` (`week` ASC, `year` ASC) ,
INDEX `fk_intercession_user` (`to_user_id` ASC, `from_user_id` ASC) ,
CONSTRAINT `fk_intercession_user`
FOREIGN KEY (`to_user_id` , `from_user_id` )
REFERENCES `intercede`.`user` (`id` , `id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_unicode_ci;


O erro mostrado é:
#1005 - Can't create table './intercede/intercession.frm'

Será que alguem pode me ajudar?

Obrigado

Options: ReplyQuote


Subject
Views
Written By
Posted
Erro ao criar tabela no MySQL
6120
September 11, 2009 11:49AM


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.