travelkind Posted January 5, 2010 Share Posted January 5, 2010 I am trying to upload some a csv file to the "raw data" table in mysql and I am getting the following error: Error SQL query: INSERT INTO `rawdata` VALUES ( '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 1 I 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 Link to comment https://forums.phpfreaks.com/topic/187313-1062-duplicate-entry-127-for-key-1/ Share on other sites More sharing options...
fenway Posted January 6, 2010 Share Posted January 6, 2010 That's because you're using a signed smallint as you're primary key -- big mistake. Try INT UNSIGNED instead. Link to comment https://forums.phpfreaks.com/topic/187313-1062-duplicate-entry-127-for-key-1/#findComment-989542 Share on other sites More sharing options...
travelkind Posted January 6, 2010 Author Share Posted January 6, 2010 Fenway, Thank you that solved my problem! Link to comment https://forums.phpfreaks.com/topic/187313-1062-duplicate-entry-127-for-key-1/#findComment-989681 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.