Title: WordPress database error: [Multiple primary key defined] &#8211; Fixed
Last modified: August 22, 2016

---

# WordPress database error: [Multiple primary key defined] – Fixed

 *  [Maruti Mohanty](https://wordpress.org/support/users/marutim/)
 * (@marutim)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wordpress-database-error-multiple-primary-key-defined-2/)
 * Hi
 * I have WP_DEBUG set to true and when I activate the plugin I get the “**WordPress
   database error: [Multiple primary key defined]**” issue.
 * I looked into the code and found a space is missing in declaring the primary 
   key. Please check [how to use db delta for creating table](http://codex.wordpress.org/Creating_Tables_with_Plugins#Creating_or_Updating_the_Table)
 * >  You must have two spaces between the words PRIMARY KEY and the definition 
   > of your primary key.
 * I fixed the issue by giving another space, hope this would be there in the next
   update.
 * Hope it helps!!
 * Thanks
 * [https://wordpress.org/plugins/rich-reviews/](https://wordpress.org/plugins/rich-reviews/)

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

 *  [wzshop](https://wordpress.org/support/users/wzshop/)
 * (@wzshop)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-multiple-primary-key-defined-2/#post-5594295)
 * Hi,
    Same here. Could you please further elaborate on how to fix this? Im quite
   new to mysql.. and wasn’t able to do what you suggested.
 * Thanks.
 *  Thread Starter [Maruti Mohanty](https://wordpress.org/support/users/marutim/)
 * (@marutim)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-multiple-primary-key-defined-2/#post-5594296)
 * Hi
 * Go to **lib/rich-reviews-db.php** line number 33 and add an extra space between“
   PRIMARY KEY” and “(id)”
 * and that will do the trick
 *  [wzshop](https://wordpress.org/support/users/wzshop/)
 * (@wzshop)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-multiple-primary-key-defined-2/#post-5594297)
 * Awesome, thank you!

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

The topic ‘WordPress database error: [Multiple primary key defined] – Fixed’ is 
closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/rich-reviews_e3f9fb.svg)
 * [Rich Reviews by Starfish](https://wordpress.org/plugins/rich-reviews/)
 * [Support Threads](https://wordpress.org/support/plugin/rich-reviews/)
 * [Active Topics](https://wordpress.org/support/plugin/rich-reviews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rich-reviews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rich-reviews/reviews/)

## Tags

 * [WordPress database error](https://wordpress.org/support/topic-tag/wordpress-database-error/)

 * 3 replies
 * 2 participants
 * Last reply from: [wzshop](https://wordpress.org/support/users/wzshop/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-multiple-primary-key-defined-2/#post-5594297)
 * Status: not resolved