Title: WordPress database error: Unknown column &#8216;link_count&#8217;
Last modified: August 18, 2016

---

# WordPress database error: Unknown column ‘link_count’

 *  [Foreigner](https://wordpress.org/support/users/foreigner/)
 * (@foreigner)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/wordpress-database-error-unknown-column-link_count/)
 * Just upgraded from wp 2.0. Had limited rights for the db (alter table was disallowed
   for wp db user). So after I’ve run upgrade.php, it showed me a lot of db errors
   regarding alter tables. Still, at the end of the page it was common message “
   There’s actually only one step. So if you see this, you’re done. Have fun!”
 * I’ve changed db user rights and run upgrade.php again. Looks to be ok now, but
   shows me the following error on mainpage of blog and inside the “Write post” 
   section:
 *     ```
       WordPress database error: [Unknown column 'link_count' in 'where clause']
       SELECT * FROM wp_categories WHERE cat_ID > 0 AND link_count > 0 ORDER BY cat_name ASC
       ```
   

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

 *  [Frank McClung](https://wordpress.org/support/users/fivemcclungs/)
 * (@fivemcclungs)
 * [19 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-unknown-column-link_count/#post-529780)
 * I’m having the exact same issue with an upgrade from 2.0 to 2.1.1., only I get
   the error in the categories tab under write post:
 * > WordPress database error: [`Unknown column ‘link_count’ in ‘where clause’]
   > 
   > SELECT cat_ID FROM wp_categories WHERE category_parent = 0 AND ( link_count
   > = 0 OR category_count != 0 OR ( link_count = 0 AND category_count = 0 ) ) ORDER
   > BY category_count DESC `
 * > Could someone please help.
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [19 years, 2 months ago](https://wordpress.org/support/topic/wordpress-database-error-unknown-column-link_count/#post-529781)
 * If you get that message, then your database did not upgrade properly. I recommend
   restoring from a backup and trying the upgrade again.
 *  [kshipp](https://wordpress.org/support/users/kshipp/)
 * (@kshipp)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-unknown-column-link_count/#post-529860)
 * Did that – restored. SAME RESULT!!!!!!
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/wordpress-database-error-unknown-column-link_count/#post-529861)
 * kshipp–may want to continue this on the other thread you commented on [http://wordpress.org/support/topic/115353](http://wordpress.org/support/topic/115353)
 *  [fev](https://wordpress.org/support/users/fev/)
 * (@fev)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-unknown-column-link_count/#post-529901)
 * I had this same error till I saw that we are supposed to run the wp-admin/upgrade.
   php program (it is in the upgrade directions of the readme.html)

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

The topic ‘WordPress database error: Unknown column ‘link_count’’ is closed to new
replies.

## Tags

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

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 5 replies
 * 6 participants
 * Last reply from: [fev](https://wordpress.org/support/users/fev/)
 * Last activity: [18 years, 8 months ago](https://wordpress.org/support/topic/wordpress-database-error-unknown-column-link_count/#post-529901)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
