Error 1005 Mysql Errno 121
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 1005 Can't Create Table (errno 121)
site About Us Learn more about Stack Overflow the company Business Learn more error 1005 can't create table (errno 121) about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x
Error 1005 Can't Create Table (errno 150)
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 can't general error 1005 can't create table (errno 121) create table errno 121 up vote 8 down vote favorite Why am I getting this error? I don't have any foreign keys drop table if exists t_issue; SET foreign_key_checks = 0;SET storage_engine=INNODB; CREATE TABLE `t_issue` ( `id_issue` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, `fk_project` int(11) DEFAULT NULL, `subject` varchar(255) DEFAULT NULL, `estimated_due_date` date DEFAULT NULL, `due_date` date DEFAULT NULL, `done_ratio` int(11) DEFAULT NULL, `fk_status` error 1005 (hy000) at line can't create table (errno 150) int(11) DEFAULT NULL, `fk_assigned_to` int(11) DEFAULT NULL, `fk_owner` int(11) DEFAULT NULL ) ENGINE=innodb DEFAULT CHARSET=latin1 mysql share|improve this question asked Mar 28 '14 at 12:14 patentul 5242417 2 Seems to work OK for me. –Malcolm Mar 28 '14 at 12:17 It's working.What error you are facing –Nagaraj S Mar 28 '14 at 12:17 It's work fine for me –Sadikhasan Mar 28 '14 at 12:19 I changed the name of the table to t_issue1 and the query works for that, for t_issue it doesen't. However I did a "Show tables" but no table named t_issue exists. What could the problem be? –patentul Mar 28 '14 at 12:20 1 It is the same previous question from you: Mysql can't create table errno 121 –Ravinder Reddy Mar 28 '14 at 12:28 | show 4 more comments 1 Answer 1 active oldest votes up vote 22 down vote accepted Mysql can't create table errno 121 You will get this message if you are trying to add a constraint with a name that is already used somewhere else. To check constraints, use the following SQL query: SELECT constrai
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
Error 1005 (hy000) Errno 121
site About Us Learn more about Stack Overflow the company Business Learn mysql errno 121 can't create table more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x
#1005 - Can't Create Table (errno 150)
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 SQL http://stackoverflow.com/questions/22712553/mysql-cant-create-table-errno-121 : ERROR 1005: Can't create table 'obl2.itemsubjects' (errno: 121) up vote 5 down vote favorite 1 I have the following tables: CREATE TABLE `OBL2`.`item` ( `itemID` INT NOT NULL AUTO_INCREMENT , `itemName` VARCHAR(45) NOT NULL , PRIMARY KEY (`itemID`) , INDEX `itemName` (`itemName` ASC) ); CREATE TABLE `OBL2`.`subject` ( `subjectID` INT NOT NULL , `subjectName` VARCHAR(45) NOT NULL , PRIMARY KEY (`subjectID`) ); now http://stackoverflow.com/questions/14294561/sql-error-1005-cant-create-table-obl2-itemsubjects-errno-121 since the connection is many to many . each item can have many subject and each subject can be related to many items - i'd like to set a connection table. this is my code: CREATE TABLE `OBL2`.`itemsubjects` ( `itemID` INT NOT NULL , `subjectID` INT NOT NULL , PRIMARY KEY (`itemID`, `subjectID`) , INDEX `itemID_idx` (`itemID` ASC) , INDEX `subjectID_idx` (`subjectID` ASC) , CONSTRAINT `itemID` FOREIGN KEY (`itemID` ) REFERENCES `OBL2`.`item` (`itemID` ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `subjectID` FOREIGN KEY (`subjectID` ) REFERENCES `OBL2`.`subject` (`subjectID` ) ON DELETE CASCADE ON UPDATE CASCADE); but for some reason the code of the 3rd table is not being accepted. i get an error msg: ERROR 1005: Can't create table 'obl2.itemsubjects' (errno: 121) i've read about the error on the internet and it says it's a known issue of MYSQL yet there are no solutions. any thoughts? mysql sql table database-design create-table share|improve this question edited Jan 12 '13 at 15:14 Saharsh Shah 21.4k52356 asked Jan 12 '13 at 15:01 ronn jack 7839 Can you try to insert some data to first two table in the script a
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any http://dba.stackexchange.com/questions/33795/error-error-1005-cant-create-table-progetto-museo-errno-121 questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site error 1005 for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top ERROR: Error 1005: Can't can't create table create table 'progetto.museo' (errno: 121) up vote 1 down vote favorite I've found on the web that: You will get this message if you're trying to add a constraint with a name that's already used somewhere else and If the table you're trying to create includes a foreign key constraint, and you've provided your own name for that constraint, remember that it must be unique within the database. Run this query to see if that name is in use somewhere BUT if you can see my script, many tables are created with the same name's INDEX... so what have i to change? (i've posted the first lines of the script to create the database, the file is much bigger) 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'; CREATE SCHEMA IF NOT EXISTS `PROGETTO` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ; USE `PROGETTO` ; -- ----------------------------------------------------- -- Table `PROGETTO`.`SETTORE` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `PROGETTO`.`SETTORE`