Title: WordPress Database Error Duplicate Entry
Last modified: September 1, 2016

---

# WordPress Database Error Duplicate Entry

 *  [ussailing](https://wordpress.org/support/users/ussailing/)
 * (@ussailing)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-7/)
 * We’ve disocered that our websites were not upgraded properly. Which resulted 
   in the tables not being changed. Does anyone know the right commands in mysql
   to create.
 * This is the old database for the wp_terms table:
 *     ```
       CREATE TABLE wp_terms (
         term_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
         name varchar(200) NOT NULL DEFAULT '',
         slug varchar(200) NOT NULL DEFAULT '',
         term_group bigint(10) NOT NULL DEFAULT '0',
         PRIMARY KEY (term_id),
         UNIQUE KEY slug (slug),
         KEY name (name)
       ) ENGINE=InnoDB AUTO_INCREMENT=644 DEFAULT CHARSET=utf8$$
       ```
   
 * And this is the new way:
 *     ```
       CREATE TABLE wp_terms (
         term_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
         name varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
         slug varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
         term_group bigint(10) NOT NULL DEFAULT '0',
         PRIMARY KEY (term_id),
         KEY slug (slug(191)),
         KEY name (name(191))
       ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci$$
       ```
   
 * I am not sure how to edit this in mysql though….

The topic ‘WordPress Database Error Duplicate Entry’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [ussailing](https://wordpress.org/support/users/ussailing/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-entry-7/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
