WordPress.org

Ready to get started?Download WordPress

Forums

"wp_categories' doesn't exist" error in database wp 2.3 (41 posts)

  1. minimalnet
    Member
    Posted 6 years ago #

    WordPress database error: [Table 'minimal_basedatos.wp_categories' doesn't exist]
    SELECT cat_ID, cat_name FROM wp_categories

    Hi, I have this error in my k2 comfiguration section when i updated to wordpress 2.3, also without any plugin activated.

    Whats the problem?.

  2. spencerp
    Member
    Posted 6 years ago #

    You running plugins that might query THAT table? As Ryan Boren stated: “The big schema change is the dropping of the categories, post2cat, and link2cat changes in favor of the new terms, term_taxonomy, and term_relationship tables. Any plugin that queries against the old table will break horribly.”

    These three tables were dropped after/during your upgrade: categories, post2cat, and link2cat. Please disable any plugins that might be using one of those three older tables, and try again. You can look here to see if your plugins were updated for 2.3 or not. Thanks.

    Also, like said on Upgrade instructions.. PLUGINS SHOULD BE DISABLED BEFORE UPGRADING BLOGS!

  3. minimalnet
    Member
    Posted 6 years ago #

    I had all the plugins deactivated to update wordpress and now in my test blog I am not using none plugin and the problem is there.

  4. minimalnet
    Member
    Posted 6 years ago #

    I have tried to do a test, to install the version 2.13, update, all fine then, but after install the 2.3 version again the same error.

  5. spencerp
    Member
    Posted 6 years ago #

    I have this error in my k2 comfiguration section

    Perhaps K2 itself is the culprit? I'm not familiar with K2 at all, did they announce any possible up-to-date versions of K2 lately, that may work on 2.3 version? As I said, I'm not familiar with K2 at all really... so I wouldn't know. Maybe someone else in here will know? Good luck. =)

  6. minimalnet
    Member
    Posted 6 years ago #

    Ok i go to try install a k2 new template for test.

  7. redsil
    Member
    Posted 6 years ago #

    I've run into the same problem with those plugins (recent posts and category exclusion) that rely on the old category schema. Does anyone have any idea how the new structure can be queried to achieve the same aim? For example, what kind of query would one need to pull recent posts from the database? Thanks.

  8. minimalnet
    Member
    Posted 6 years ago #

    Finally seems was k2 template problem, i removed this lines in the configuration and now seems work fine:

    // Get the asides category
    	$asides_id = get_option('k2asidescategory');
    	$asides_title = $asides_id != 0 ? $wpdb->get_var("SELECT cat_name from $wpdb->categories WHERE cat_ID = $asides_id LIMIT 1") : __('No Asides','k2_domain');
    
    	// Get the categories we might use for asides
    	$asides_cats = $wpdb->get_results("SELECT cat_ID, cat_name FROM $wpdb->categories");
    
    			<h3><?php _e('Asides','k2_domain'); ?></h3>
    
    			<p><small><?php _e('\'Asides\' is a category of entries, meant to be \'smaller\' and perhaps of \'less importance\', like for instance links with minor commentary. They are styles differently than other entries to separate them content-wise. Below you can select a category to be shown as Asides.','k2_domain'); ?></small></p>
    
    			<p>
    				<select id="k2-asidescategory" name="k2[asidescategory]">
    					<option value="0" <?php selected($asides_id, '0'); ?>><?php _e('No Asides','k2_domain'); ?></option>
    
    					<?php foreach ($asides_cats as $cat) { ?>
    					<option value="<?php echo attribute_escape($cat->cat_ID); ?>" <?php selected($asides_id, $cat->cat_ID); ?>><?php echo($cat->cat_name); ?></option>
    					<?php } ?>
    				</select>
    			</p>
  9. I found out that my Ultimate Tag Warrior plugin was the one generating these errors. I would import that plugins tags into the native tags area but where the hell are the importers? I can't find them

  10. DonPietro
    Member
    Posted 6 years ago #

    I'm getting the same error using the Custom Query String UTW plug-in.

    Hopefully the developers of these plug-ins will release updates for 2.3 soon. Its really appreciated.

  11. spencerp
    Member
    Posted 6 years ago #

    I would import that plugins tags into the native tags area but where the hell are the importers? I can't find them

    Top navigation menu...MANAGE > IMPORT

  12. americasroof
    Member
    Posted 6 years ago #

    I did four upgrades that had no problems on two different domains hosted by the same ISP. However two upgrades on a different domain hosted by a different ISP had this problem. This is a VERY serious problem as it is exposing the database structure. I hope it can get resolved quickly. Thanks.

  13. silencer
    Member
    Posted 6 years ago #

    my k2 based site is running.. i had some errors while upgrading using upgrade.php and the interface worked fine.. i imported the tags from UTW and disabled utw and similar post plugins along with few others.... now the error when i post something or try to delete the post.. it says things like

    WordPress database error: [Table 'XXX.wp_post2cat' doesn't exist]
    SELECT YEAR(post_date) AS year, MONTH(post_date) AS month, category_id FROM wp_posts INNER JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) WHERE post_date > 0 AND category_id <> 11 AND category_id <> 2 AND category_id <> 7 AND ID = 247 ORDER By post_date DESC

    WordPress database error: [Table 'xxxx.wp_post2cat' doesn't exist]
    SELECT DISTINCT YEAR(p.post_date) AS year FROM wp_posts p INNER JOIN wp_post2cat p2c ON (p.ID = p2c.post_id) WHERE p.post_date > 0 AND p2c.category_id <> 11 AND p2c.category_id <> 2 AND p2c.category_id <> 7 ORDER By p.post_date DESC

    WordPress database error: [Table 'XXX.wp_post2cat' doesn't exist]
    SELECT DISTINCT MONTH(p.post_date) AS month FROM wp_posts p INNER JOIN wp_post2cat p2c ON (p.ID = p2c.post_id ) WHERE YEAR(p.post_date) = 2007 AND p2c.category_id <> 11 AND p2c.category_id <> 2 AND p2c.category_id <> 7 AND p.post_date_gmt < '2007-09-27 10:33:01' ORDER By p.post_date DESC

    WordPress database error: [Table 'XXX.wp_categories' doesn't exist]
    SELECT cat_ID, cat_name, category_nicename, category_parent FROM wp_categories c WHERE c.cat_ID > 0 AND c.cat_ID <> 11 AND c.cat_ID <> 2 AND c.cat_ID <> 7 ORDER BY c.cat_ID asc

    WordPress database error: [Table 'XXXX.wp_categories' doesn't exist]
    SELECT c.cat_ID, COUNT(distinct p2c.post_id) AS cat_count FROM wp_categories c INNER JOIN wp_post2cat p2c ON (c.cat_ID = p2c.category_id) INNER JOIN wp_posts p ON (p.ID = p2c.post_id) WHERE p.post_status = 'publish' AND p.post_date_gmt < '2007-09-27 10:33:01' AND c.cat_ID <> 11 AND c.cat_ID <> 2 AND c.cat_ID <> 7 GROUP BY p2c.category_id

    WordPress database error: [Table 'XXXX.wp_post2cat' doesn't exist]
    SELECT cat_ID AS ID, MAX(post_modified) AS last_mod FROM wp_posts p LEFT JOIN wp_post2cat pc ON p.ID = pc.post_id LEFT JOIN wp_categories c ON pc.category_id = c.cat_ID WHERE post_status = 'publish' GROUP BY cat_ID

    but the fun part is the POST is posted take a look at the bunch of image links i've posted
    http://img233.imageshack.us/img233/1562/wppost1kj6.jpg
    http://img264.imageshack.us/img264/4482/wppost2kk5.jpg
    http://img146.imageshack.us/img146/2569/wppost3lq2.jpg

    anyone has any idea on solving this issue?

  14. americasroof
    Member
    Posted 6 years ago #

    Upon further thought about the problems on my installations. I wonder I successful upgrades from an incremental version while the unsuccessful upgrade was based on an much earlier version of wp (I don't recall the delete tables command on the successful upgrade).

    It seems like there are a lot of installation problem posts. Is there a way to safely DOWNGRADE to a more stable version that avoids this (and other problems)?

  15. americasroof
    Member
    Posted 6 years ago #

    BTW minimalnet what file had the configuration you mentioned earlier?

    Also, I don't know what you mean when you are referring to "K2"

    Thanks.

  16. silencer
    Member
    Posted 6 years ago #

    @americasroof - k2 is a well known simple manageable template which offers a bit more than the usual.. http://www.getk2.com..

    have a look at the pictures.. after all the error while posting.. it actually post the entry.. ;]

  17. borntorun
    Member
    Posted 6 years ago #

    I am still having a huge problem with my blog since I tried to upgrade to 2.3.

    Before the upgrade I backed up everything and then used subversion to get 2.3. I saw the database errors described. I decided to roll back, so I deleted the new directory and restored my old directory. I'm back on 2.2.2 (so my admin panel assures me), but now I'm still getting error messages at the top of every post

    Categories:

    WordPress database error: [Table 'payless_gartenbergcom.wp_post2cat' doesn't exist]
    SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (676)
    Uncategorized

    as well as error messages for my blogroll

    WordPress database error: [Table 'payless_gartenbergcom.wp_categories' doesn't exist]
    SELECT * FROM wp_categories

    Any ideas on how to get the old version of WordPress working properly again? I'm giving up on 2.3 for now, but would like to have a functioning blog without tons of errors. Thanks.

  18. americasroof
    Member
    Posted 6 years ago #

    I wound up using phpmyadmin to add the wp_categories table back. It wasn't picky about field names or descriptors and that has gotten rid of the message. It does not appear to be affecting my blogs in anyway other than getting rid of the message.

  19. borntorun
    Member
    Posted 6 years ago #

    GREAT idea, thanks. I thought my database was restored, but it wasn't. All is working fine again!

    It's going to be awhile before I try to upgrade to the new version again.

  20. TheAfter
    Member
    Posted 6 years ago #

    i found this great explanation here:
    just need to edit theme templates a little bit by replacing 3 stuffs:

    * cat_ID –> term_ID
    * categories –> terms
    * cat_name –> name

    found here

  21. rondamon
    Member
    Posted 6 years ago #

    Hi, i deactivate the google site maps plugin for solve this problem;

    Google Sitemaps 2.7.1

    there are anothers plugins with the same problems

  22. slambert
    Member
    Posted 6 years ago #

    has anyone tried finding and replacing these terms:

    * cat_ID –> term_ID
    * categories –> terms
    * cat_name –> name

    In the Custom Query String plugin to see if it will work?

  23. mjesales
    Member
    Posted 6 years ago #

    I had a plugin that wasn't working and after doing the replace - as suggested above:

    * cat_ID –> term_ID
    * categories –> terms
    * cat_name –> name

    I was able to get it to work - I had to change it a little bit as well - because it was calling post2cat as well - so I changed that to post2terms.

  24. slambert
    Member
    Posted 6 years ago #

    Interesting. That was just a hunch. Glad it worked. Can anyone else verify that this is all it would take to update the Custom Query String plugin?

  25. lexthoonen
    Member
    Posted 6 years ago #

    I've got it worse than any of you I guess. I upgraded to 2.3, but didn't disbale the plugins first. Site didn't work anymore. It shows a 'cannot display page' in IE and in firefox the pages are cut off. In firefox, I could get into the admin. So i disabled all plugins, reverted to the default theme, but the problem stayed. Even worse: all sites on that dedicated server that use mysql are in problems now. They don't work, or work half. If I use 'top' in the shell, I can see that mysqld just builds up and up in time. 've tried a lot now (rebooted the server, restarted mysql, but nothing seems to work). So apart from my wordpress site not working, lots of other sites now don't work either.

    If anyone thinks of a possible solution, that'd be great!

  26. slambert
    Member
    Posted 6 years ago #

    this thread seems to have a solution for the Custom Query String problem:
    http://wordpress.org/support/topic/135636?replies=6

    @lexthoonen - your database was updated during the upgrade. Unless your restored the old database, you'll probably see the same problems. It's not clear to me what the cause was. Perhaps you'll have better luck if you introduce this as a new thread?

  27. tk2
    Member
    Posted 6 years ago #

    I got the same problem too.
    The problem lies in the Google Sitemap plugin.
    Try disabling it and see any improvement.

  28. stonegauge
    Member
    Posted 6 years ago #

    I'm using a variant of the ancient Trident theme on my blog ( http://www.fanhome.com ) and nothing seems to be working out when I try correcting this issue. I'm looking for the category tags as specified above but can't find them in my index or sidebar files.

    At worst, can someone recommend a good 3 column theme that I can customize to suit this blog? :( Trying to figure out the conflict is driving me crazy

  29. moshu
    Member
    Posted 6 years ago #

    A plugin or some tags in your old theme are calling the wrong DB table.

    Check the Template_Tags section, and see if any deprecated template tag is used in your theme. I'd bet they are there. Replace them with the new ones (that say for WP 2.1)

  30. stonegauge
    Member
    Posted 6 years ago #

    Moshu, THANK YOu for pointing me to that page (I tried searching for it but under the guise of how to update your WordPress theme for 2.3 -- I kept getting tag support pages). This should take up the rest of my afternoon but I'm pretty sure it's got to be a tag that has Deprecated. (I already tried deactivating all plugins, the problem still existed).

Topic Closed

This topic has been closed to new replies.

About this Topic