sashi34u Posted July 22, 2009 Share Posted July 22, 2009 Hi, I have installed WAMPSERVER version WampServer 2.0i [07/11/09] Includes : - Apache 2.2.11 - MySQL 5.1.36 - PHP 5.3.0 I am trying to upload a .csv file onto the mysql server using the folowing command. LOAD DATA INFILE 'C:\\Documents and Settings\\Sashikanth Gurram\\Desktop\\courses\\Web_Application\\occupancy.csv' INTO TABLE OCCUPANCY FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'; When I am using this command, I am getting the error as follows ERROR 1062 (23000): Duplicate entry 'P12N-January-Monday-8:00' for key 'PRIMARY' Can you please let me know what the problem is? I have used the same file previously in my VISTA OS and it worked fine then. I am currently using it in my XP OS and now I am facing this problem. Can you please let me know what the problem is? Thanks, Sashi Quote Link to comment https://forums.phpfreaks.com/topic/166947-error-1062-23000/ Share on other sites More sharing options...
gassaz Posted July 22, 2009 Share Posted July 22, 2009 That is because you have a duplicated key... maybe the structure has changes... check the primary keys of the table.. Quote Link to comment https://forums.phpfreaks.com/topic/166947-error-1062-23000/#findComment-880482 Share on other sites More sharing options...
Maq Posted July 22, 2009 Share Posted July 22, 2009 Can you please let me know what the problem is? A PK is unique. You're trying to insert a duplicate value in a field that's a PK. Quote Link to comment https://forums.phpfreaks.com/topic/166947-error-1062-23000/#findComment-880490 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.