• For whatever reason, when i attempt to create and save a category, this is the message i get: Could not insert term into the database

    my older version of wordpress had all my posts neatly arranged to specific categories, when i upgraded they vaporized, and now i’m unable to organize.

    any ideas?

    thanks.
    mary

Viewing 4 replies - 1 through 4 (of 4 total)
  • Sounds like the upgrade didn’t work properly.

    Does your WordPress database contain the files that are listed in Database Description?

    If not you may need to restore and redo the upgrade.

    I’m assuming ‘upgrade’ here because you mentioned ‘older version’.

    My wife discovered that the categories in her blog were missing. When I got the “Could not insert” msg, I tried my blog (different WP database on the same server). Same problem there.

    I Googled and found this topic.

    I checked against DataBase description and found that
    _term_relationships,_term_taxonomy and _terms were missing.

    I checked another server I manage, and those tables were present.

    Both servers are running WP 2.5.1 on Fedora 9. The only significant difference, IMO, is that the server without problems is using the ‘wordpress’ default for DB_NAME and DB_USER, whereas the server with the problems is using non-default values for these.

    My suspicion, based on maryr’s implication that the problem cropped up with 2.5.1, and my suspicion that this also happened with my problematic server, is that 2.5.1 has a bug in updating existing databases.

    I normally just have MySQL backups, so didn’t see a clean way to recover. I fetched the table definitions from a backup of the good server, ran CREATEs on the problematic server, and am not able to manually re-enter categories and assign posts to categories. Not fun, but not terrible.

    Actually, a MySQL backup from before the upgrade would help.

    Backup your current database just in case, then DROPs the table from your database, restore your ‘pre-upgrade’ database then do the wp-admin/upgrade.php thing.

    Note: If you don’t have a backup of the database, then you might try doing wp-admin/upgrade.php. If necessary you may have to force a database upgrade.

    I had this problem and solved it today. As MichaelH suspected, it was an upgrade problem – it turned out my WordPress database user didn’t have enough privileges to complete the upgrades.

    In my case, I hadn’t lost my categories; they were still in the old wp_categories table, which was supposed to have been replaced with the trio of wp_term tables somewhere along the line. The thing was, even though I had upgraded, WordPress hadn’t changed the database structure.

    So I gave its database user privileges to alter the structure (create, drop, alter, etc) and forced a database upgrade as above, and it worked! My categories are once again listed in the admin panel and my posts still belong to them.

    I hope that helps!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to add a category?’ is closed to new replies.