Title: WordPress database error &#8211; Duplicate key name
Last modified: October 28, 2016

---

# WordPress database error – Duplicate key name

 *  [decarvalhoaa](https://wordpress.org/support/users/decarvalhoaa/)
 * (@decarvalhoaa)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-key-name/)
 * I have notice during the upgrade of both Version 2.6.6 and 2.6.7 the following
   PHP notice in my logs, with debug on.
 *     ```
       [28-Oct-2016 15:16:41 UTC] WordPress database error Duplicate key name 'location_type_code' for query ALTER TABLE wp_woocommerce_tax_rate_locations ADD KEY 'location_type_code' ('location_type'(40),'location_code'(90)) made by require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, WC_Install::check_version, WC_Install::install, WC_Install::create_tables, dbDelta
       [28-Oct-2016 15:16:41 UTC] WordPress database error Duplicate key name 'location_type_code' for query ALTER TABLE wp_woocommerce_shipping_zone_locations ADD KEY 'location_type_code' ('location_type'(40),'location_code'(90)) made by require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, WC_Install::check_version, WC_Install::install, WC_Install::create_tables, dbDelta
       ```
   
 * It only happens during the update. During normal operations, there is no issue,
   but I don’t know whether this can have side effects.
 * Any recommendation on how to resolve this and can this be reproduce by others?
    -  This topic was modified 9 years, 7 months ago by [decarvalhoaa](https://wordpress.org/support/users/decarvalhoaa/).
    -  This topic was modified 9 years, 7 months ago by [decarvalhoaa](https://wordpress.org/support/users/decarvalhoaa/).
    -  This topic was modified 9 years, 7 months ago by [decarvalhoaa](https://wordpress.org/support/users/decarvalhoaa/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [anphira](https://wordpress.org/support/users/anphira/)
 * (@anphira)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-key-name/#post-8373322)
 * [@decarvalhoaa](https://wordpress.org/support/users/decarvalhoaa/) you should
   try contacting the woo developers on their github project, they don’t monitor
   these boards.
 *  Thread Starter [decarvalhoaa](https://wordpress.org/support/users/decarvalhoaa/)
 * (@decarvalhoaa)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-key-name/#post-8373412)
 * Thanks for the head-up [@anphira](https://wordpress.org/support/users/anphira/)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WordPress database error – Duplicate key name’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [Database Error](https://wordpress.org/support/topic-tag/database-error/)
 * [PHP Notice](https://wordpress.org/support/topic-tag/php-notice/)
 * [upgrade](https://wordpress.org/support/topic-tag/upgrade/)

 * 2 replies
 * 2 participants
 * Last reply from: [decarvalhoaa](https://wordpress.org/support/users/decarvalhoaa/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/wordpress-database-error-duplicate-key-name/#post-8373412)
 * Status: not resolved