0

I'm new to PHP!

I'm trying to import an SQL database file into myPhpAdmin for a WordPress I'm migrating, but I keep getting this error message:

SQL query:

`-- -- Dumping data for table `wp_commentmeta` -- INSERT INTO `wp_commentmeta` (`meta_id`, `comment_id`, `meta_key`, `meta_value`) VALUES (1, 3, 'rating', '5'), (37, 39, 'rating', '5'), (35, 37, 'is_customer_note', '0'), (4, 6, 'is_customer_note', '0'), (5, 7, 'is_customer_note', '0'), (6, 8, 'is_customer_note', '0'), (7, 9, 'is_customer_note', '0'), (8, 10, 'is_customer_note', '0'), (9, 11, 'is_customer_note', '0'), (10, 12, 'is_customer_note', '0'), (11, 13, 'is_customer_note', '0'), (34, 36, 'is_customer_note', '0'), (13, 15, 'is_customer_note', '0'), (14, 16, 'is_customer_note', '0'), (15, 17, 'is_customer_note', '0'), (16, 18, 'is_customer_note', '0'), (17, 19, 'is_customer_note', '0'), (18, 20, 'is_customer_note', '0'), (19, 21, 'is_customer_note', '0'), (45, 44, 'rating', '4'), (46, 45, 'rating', '4'), (22, 24, 'is_customer_note', '0'), (23, 25, 'is_customer_note', '0'), (24, 26, 'is_customer_note', '0'), (25, 27, 'is_customer_note', '0'), (26, 28, 'is_customer_note', '0'), (2[...]

MySQL said: Documentation

#1062 - Duplicate entry '1' for key 'PRIMARY'

From looking at the SQL file, I see:

INSERT INTO `wp_commentmeta` (`meta_id`, `comment_id`, `meta_key`, `meta_value`) VALUES

followed by a list of table data with different values. Would deleting this section of code fix the error I'm getting?

  • 1
    What does SELECT * FROM wp_commentmeta WHERE PRIMARY = 1 Return? – eyoung100 May 16 '14 at 20:13
  • How can I find this out? I think the problem is that the table is already filled out and it's trying to refill it out. I can see on the left the table it's talking about, wp_commentmeta and clicking on it I can see there are already values, first one being '1'... Is this file already imported? – little tiny man May 18 '14 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.