Title: Error in DB
Last modified: August 20, 2016

---

# Error in DB

 *  [Vizman](https://wordpress.org/support/users/vizman/)
 * (@vizman)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/error-in-db-1/)
 * Hi, I’m trying to access my wp-admin area (dashboard) but getting this error:
 * WordPress database error Multiple primary key defined for query ALTER TABLE wp_woocommerce_downloadable_product_permissions
   ADD PRIMARY KEY (product_id,order_id,order_key,download_id) made by require_once(‘
   C:\HostingSpaces\xxxxx\xxxxx.com\wwwroot\wp-admin\admin.php’), do_action(‘admin_init’),
   call_user_func_array, Woocommerce->update, Woocommerce->install, do_install_woocommerce,
   woocommerce_tables_install, dbDelta
 * Any ideas? It looks like an upgrade error of sorts.
 * TIA,
 * Viz
 * [http://wordpress.org/extend/plugins/woocommerce/](http://wordpress.org/extend/plugins/woocommerce/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/error-in-db-1/#post-3606222)
 * Before doing that, the update process does this:
 * `$wpdb->query( "ALTER TABLE {$wpdb->prefix}woocommerce_downloadable_product_permissions
   DROP PRIMARY KEY" );`
 * So you shouldn’t have a primary key. Does the MySQL user associated with your
   install have full Alter permissions?
 * You could perhaps edit that table manually via PHPMyAdmin and drop the key yourself.
   That way the update process will set it correctly.

Viewing 1 replies (of 1 total)

The topic ‘Error in DB’ 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

 * [woocommerce plugin](https://wordpress.org/support/topic-tag/woocommerce-plugin/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/error-in-db-1/#post-3606222)
 * Status: not resolved