I'm having a problem importing the database of a blog. When I try and do it, it will import some of the database (the comments) but then it comes up with this error: SQL query: -- -- Dumping data for table `mostAccessed` -- INSERT INTO `mostAccessed` ( `postnumber` , `cntaccess` ) VALUES ( 5, 1893 ) , ( 6, 1572 ) , ( 7, 2469 ) , ( 8, 2610 ) , ( 4, 1959 ) , ( 3, 1173 ) , ( 2, 108 ) , ( 9, 5627 ) , ( 10, 1399 ) , ( 11, 1053 ) , ( 12, 503 ) ; MySQL said: Documentation #1062 - Duplicate entry '5' for key 1 Code (markup): I don't know much about databases so am a little confused what the problem may be. Any ideas?
Looks like you're trying to import it into an existing database so you're getting duplicate primary (id) keys. Databases use primary keys for referencing with related tables, for example to maintain the relationship between a post and it's comments. The primary keys must be unique or you'll get different data relating to the same post or the same data relating to different posts.
your table should be clean while importing the new entry .... or better delete all the entry of the primary key .. its auto incrementing ...