Mysql Error Duplicate Entry 127 For Key 1
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings mysql error 1062 duplicate entry for key primary and policies of this site About Us Learn more about Stack duplicate entry '1' for key 'primary' mysql Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs duplicate entry for key 'primary' mysql Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them;
Error Code 1062 Duplicate Entry For Key Primary
it only takes a minute: Sign up Error Code: 1062. Duplicate entry '1' for key 'PRIMARY' up vote 9 down vote favorite 5 I have a problem on this error message, when i try this: INSERT INTO `PROGETTO`.`UFFICIO-INFORMAZIONI` (`ID`, `viale`, `num_civico`, `data_apertura`, `data_chiusura`, `orario_apertura`, `orario_chiusura`, `telefono`, `mail`, `web`, `Nome-paese`, `Comune`) VALUES (1, 'Viale Cogel ', '120', '2012-05-21', '2012-09-30', '08:00', '23:30', duplicate entry '1' for key 'primary' mysql import '461801243', 'informazioni@bolzano.it', 'Bolzanoturismo.it', 'Bolzano', 'BZ') Error Code: 1062. Duplicate entry '1' for key 'PRIMARY' I haven't auto_increment data, PLEASE HELP me! This is the table related, UFFICIO-INFORMAZIONI CREATE TABLE IF NOT EXISTS `PROGETTO`.`UFFICIO-INFORMAZIONI` ( `ID` INT(11) NOT NULL , `viale` VARCHAR(45) NULL , `num_civico` VARCHAR(5) NULL , `data_apertura` DATE NULL , `data_chiusura` DATE NULL , `orario_apertura` TIME NULL , `orario_chiusura` TIME NULL , `telefono` VARCHAR(15) NULL , `mail` VARCHAR(100) NULL , `web` VARCHAR(100) NULL , `Nome-paese` VARCHAR(45) NOT NULL , `Comune` CHAR(2) NOT NULL , PRIMARY KEY (`ID`) , INDEX `Nome_paese` (`Nome-paese` ASC) , INDEX `Comune` (`Comune` ASC) , CONSTRAINT `Nome_paese` FOREIGN KEY (`Nome-paese` ) REFERENCES `PROGETTO`.`PAESE` (`Nome-paese` ) ON DELETE NO ACTION ON UPDATE CASCADE, CONSTRAINT `Comune` FOREIGN KEY (`Comune` ) REFERENCES `PROGETTO`.`PAESE` (`Comune` ) ON DELETE NO ACTION ON UPDATE CASCADE) ENGINE = InnoDB INSERT INTO INSERT INTO `PROGETTO`.`UFFICIO-INFORMAZIONI` (`ID`, `viale`, `num_civico`, `data_apertura`, `data_chiusura`, `orario_apertura`, `orario_chiusura`, `telefono`, `mail`, `web`, `Nome-paese`, `Comune`) VALUES (1, 'Viale Cogel ', '120', '2012-05-21', '2012-09-30', '08:00', '23:30', '461801243', 'informazioni@bolzano.it', 'Bolzanoturismo.it', 'Bolzano', 'BZ'); INSERT INTO `PROGETTO`.`UFFICIO-INFORMAZIONI` (`ID`, `viale`, `num_civico`, `data_apertura`, `data_chiusura`, `orario_ape
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 duplicate entry '0' for key 'primary' mysql site About Us Learn more about Stack Overflow the company Business Learn more
Duplicate Entry For Key Primary Error
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x
#1062 - Duplicate Entry '1' For Key 'primary' Phpmyadmin
Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up #1062 - http://stackoverflow.com/questions/14628269/error-code-1062-duplicate-entry-1-for-key-primary Duplicate entry for key 'PRIMARY' up vote 4 down vote favorite 3 So my MySQL database is behaving a little bit wierd. This is my table: Name shares id price indvprc cat 2 4 81 0 goog 4 4 20 20 fb 4 9 20 20 I'm getting this #1062 error when I try to insert into the table. So I looked into it http://stackoverflow.com/questions/11638505/1062-duplicate-entry-for-key-primary further and realized that when I try to insert values into the table, in which the name and shares values are the same, it will return the #1062 error. For example, If i inserted: fb 4 6 20 20 It would return an error. But if i changed the shares number to 6, it would run fine. Is it because of one of my columns that could be unique, or is it just something with mysql? mysql sql mysql-error-1062 share|improve this question asked Jul 24 '12 at 20:05 irosenb 1431622 1 what is the primary key on your table? You cannot have duplicate values in a primary key field. A primary key can also consist of multiple fields so what fields are in your key? –bluefeet♦ Jul 24 '12 at 20:06 Don't know for sure, but could your database have formed a relationship between shares and id ? take a look in phpMyAdmin and see what you can find.... –dykeag Jul 24 '12 at 20:08 1 Most likely you primary key is composed by the columns Name and shares. That means that the combination of both col
Detected You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality. #1062 - Duplicate entry '127' https://forums.phpfreaks.com/topic/187313-1062-duplicate-entry-127-for-key-1/ for key 1 Started by travelkind, Jan 05 2010 08:56 PM Please log in to reply 2 replies to this topic #1 travelkind travelkind Advanced Member Members 75 posts Posted 05 January 2010 - 08:56 PM I am trying to upload some a csv file to the "raw data" table in mysql and I am getting the following error:ErrorSQL query: INSERT INTO `rawdata` VALUES ( duplicate entry '128', 'CI', 'TA', 'TA', 'TA', 'FL', 'P UL LS DIESEL', 'U', '12/28/2009', '18:00', '2.142', '0.037') MySQL said: #1062 - Duplicate entry '127' for key 1I am using Server version: 5.0.67.d7 of mysql. I have tried the import a few different times (with different data) and the import seems to only import 127 rows of data.Can anyone please help me with this?Thanks Back to top for key 'primary' #2 fenway fenway MySQL Si-Fu / PHP Resident Alien Staff Alumni 16,199 posts LocationToronto, ON Posted 06 January 2010 - 10:50 AM That's because you're using a signed smallint as you're primary key -- big mistake. Try INT UNSIGNED instead. Seriously... if people don't start reading this before posting, I'm going to consider not answering at all. Back to top #3 travelkind travelkind Advanced Member Members 75 posts Posted 06 January 2010 - 01:56 PM Fenway,Thank you that solved my problem! Back to top Back to MySQL Help · Next Unread Topic → 0 user(s) are reading this topic 0 members, 0 guests, 0 anonymous users Reply to quoted postsClear PHP Freaks → SQL / Database Forums → MySQL Help Privacy Policy Forum Rules & Terms of Service · Change Theme IP.Board Mobile PHP Freaks PHP Freaks - English (USA) English (USA) PHP Freaks - English (USA) Mark Community Read Forums Members Pages Mark all as read Help Community Forum Software by IP.BoardLicensed to: PHP Freaks Sign In Use Facebook Use Twitter Need an account? Register now! Username Password I've forgotten my password Remember me This is not recomme