Error 121 In Mysql
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this mysql error 150 site About Us Learn more about Stack Overflow the company Business Learn
Mysql Error 1005
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
Mysql Error 121 Foreign Key
x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up MySQL
Mysql Errno 121
errorno 121 up vote 32 down vote favorite 5 I'm getting this error in MySQL create. I'm doing: CREATE TABLE `blogReply` ( `Id` INT(24) NOT NULL AUTO_INCREMENT COMMENT 'Primary Key of This Table', `blogId` INT(24) NOT NULL COMMENT 'Blog where this reply was posted', `userId` INT(24) NULL COMMENT 'User the blog was posted by', `name` VARCHAR(100) NULL DEFAULT 'Unknown' COMMENT 'The Name of the mysql error 1064 user that the reply was posted by', `email` VARCHAR(100) NULL DEFAULT 'Unknown' COMMENT 'The Email of the user that the reply was posted by', `http` VARCHAR(300) NULL DEFAULT 'Unknown' COMMENT 'The Webaddress of the user that the reply was posted by', `message` TEXT NOT NULL COMMENT 'text of the blog', `votes` INT(10) DEFAULT 0 COMMENT 'Rating of the Blog', `ratedBy` TEXT COMMENT 'People who have already Voted on this blog', `dateReg` BIGINT NOT NULL COMMENT 'Date the User was Registered', PRIMARY KEY (`Id`), CONSTRAINT `FK_userId` FOREIGN KEY(`userId`) REFERENCES `user` (`Id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `FK_blogId` FOREIGN KEY(`blogId`) REFERENCES `blog` (`Id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB; Any Ideas? The Error States: Can't create table './xxxxxxxx/blogReply.frm' (errno: 121) mysql foreign-keys mysql-error-1005 share|improve this question edited Nov 6 '12 at 11:08 Teun Zengerink 2,72941929 asked Jul 24 '09 at 23:30 Angel.King.47 3,819124070 add a comment| 4 Answers 4 active oldest votes up vote 107 down vote accepted Check that all your constraints are really spelled out correctly, also check that there's not any other tables that uses the constraint names FK_userId or F
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us mysql drop foreign key Learn more about Stack Overflow the company Business Learn more about hiring developers mysql constraint or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack mysql rename database Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up SQL - error code 1005 with error http://stackoverflow.com/questions/1180660/mysql-errorno-121 number 121 up vote 12 down vote favorite 4 I'm running the following MySQL script (trimmed down), generated automatically by MySQL Workbench and I get the following error: Error Code: 1005 Can't create table 'regula.reservation' (errno: 121) I'm not very proficient with databases and this error is not very informative. What is the problem here? -- ----------------------------------------------------- -- Table `regula`.`Users` -- ----------------------------------------------------- DROP TABLE IF EXISTS `regula`.`Users` http://stackoverflow.com/questions/4412693/sql-error-code-1005-with-error-number-121 ; CREATE TABLE IF NOT EXISTS `regula`.`Users` ( `idUsers` INT UNSIGNED NOT NULL AUTO_INCREMENT , `name` TEXT NOT NULL , `type` TEXT NOT NULL , `pwd` TEXT NOT NULL , PRIMARY KEY (`idUsers`) , UNIQUE INDEX `idUsers_UNIQUE` (`idUsers` ASC) ) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `regula`.`Projects` -- ----------------------------------------------------- DROP TABLE IF EXISTS `regula`.`Projects` ; CREATE TABLE IF NOT EXISTS `regula`.`Projects` ( `idProjects` INT UNSIGNED NOT NULL AUTO_INCREMENT , `ownerId` INT UNSIGNED NOT NULL , `name` TEXT NOT NULL , `date` DATE NOT NULL , `time` TIME NOT NULL , `place` TEXT NOT NULL , `itemType` INT NOT NULL , PRIMARY KEY (`idProjects`) , UNIQUE INDEX `idProjects_UNIQUE` (`idProjects` ASC) , INDEX `ownerId` (`ownerId` ASC) , CONSTRAINT `ownerId` FOREIGN KEY (`ownerId` ) REFERENCES `regula`.`Users` (`idUsers` ) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `regula`.`ItemTypes` -- ----------------------------------------------------- DROP TABLE IF EXISTS `regula`.`ItemTypes` ; CREATE TABLE IF NOT EXISTS `regula`.`ItemTypes` ( `idItemTypes` INT UNSIGNED NOT NULL , `prjId` INT UNSIGNED NOT NULL , `parentId` INT UNSIGNED NULL DEFAULT NULL , `name` TEXT NOT NULL , PRIMARY KEY (`idItemTypes`) , INDEX `prjId` (`prjId` ASC) , INDEX `parentId` (`parentId` ASC) , CONSTRAINT `prjId` FORE
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow http://stackoverflow.com/questions/15419934/mysql-forward-engineer-sql-giving-error-121 the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up MySQL Forward Engineer - SQL giving error 121 up vote 0 down vote favorite I'm currently trying mysql error to create my database using the Forward Engineer wizard of MySQL Workbench but I get this error: Executing SQL script in server ERROR: Error 1005: Can't create table 'microweb.users' (errno: 121) CREATE TABLE IF NOT EXISTS `microweb`.`users` ( `user_id` INT UNSIGNED NOT NULL AUTO_INCREMENT , `role_id` INT UNSIGNED NOT NULL , `username` VARCHAR(45) NOT NULL , `password` VARCHAR(45) NOT NULL , `email` VARCHAR(45) NOT NULL , `salt` VARCHAR(45) NOT NULL , `first_name` error 121 in VARCHAR(45) NOT NULL , `middle_name` VARCHAR(45) NULL , `last_name` VARCHAR(45) NOT NULL , `address_id` INT UNSIGNED NULL , `registration_id` INT UNSIGNED NOT NULL , `active` TINYINT(1) NOT NULL , `banned` TINYINT(1) NOT NULL , PRIMARY KEY (`user_id`) , UNIQUE INDEX `user_id_UNIQUE` (`user_id` ASC) , UNIQUE INDEX `username_UNIQUE` (`username` ASC) , UNIQUE INDEX `email_UNIQUE` (`email` ASC) , UNIQUE INDEX `registration_id_UNIQUE` (`registration_id` ASC) , CONSTRAINT `fk_user_role` FOREIGN KEY (`role_id` ) REFERENCES `microweb`.`roles` (`role_id` ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_user_registration` FOREIGN KEY (`registration_id` ) REFERENCES `microweb`.`registrations` (`registration_id` ) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB SQL script execution finished: statements: 10 succeeded, 1 failed The complete scripts contains a lot of foreign keys and 21 tables. The problem is that there's only 2 in phpMyAdmin after the execution when Workbench says there's 10 successful. If someone need the complete model, just tell me. mysql foreign-keys mysql-workbench share|improve this question asked Mar 14 '13 at 20:52 Frederick Marcoux 1,3001340 Which version of MySQL Workbench is this? Are you using the latest one? –Mike Lischke Mar 15 '13 at 8:36 @MikeLischke Yes, I installed it 4 days ago. –Frederick Marcoux Mar 15 '13 at 8:44 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote a