WordPress.org

Ready to get started?Download WordPress

Forums

Stupid WordPress SQL (36 posts)

  1. netMASA
    Member
    Posted 7 years ago #

    AH!

    I updated to the latest version of wordpress (AFTER I CHECKED WHAT'S NEEDED AND WHAT PLUGINS DON'T WORK). And after doing so I get this for my blogroll (there are 5 blogs for 5 errors):

    WordPress database error: [Table 'mysql_namedemo.wp_link2cat' doesn't exist]
    SELECT category_id FROM wp_link2cat WHERE link_id = 11 ORDER BY category_id

    WordPress database error: [Table 'mysql_namedemo.wp_link2cat' doesn't exist]
    SELECT category_id FROM wp_link2cat WHERE link_id = 9 ORDER BY category_id

    And this shows up in the category box when I make a post. However the categories show up fine on the site:

    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

  2. Chris_K
    Member
    Posted 7 years ago #

    Was this before or after you ran http://yoursite.com/blog/wp-admin/upgrade.php ?

  3. spartikus
    Member
    Posted 7 years ago #

    I'm getting the same thing. I ran upgrade.php and the problem is still there.

  4. netMASA
    Member
    Posted 7 years ago #

    after I ran upgrade.php. then I ran it again (because I found one small setting that was causing the whole site not to show [I checked all the files except for akiment and found it didn't update]) and now I still have these errors.

  5. arboltsef
    Member
    Posted 7 years ago #

    I´m having the same errors.

  6. netMASA
    Member
    Posted 7 years ago #

    Arg. Could this please be fixed?

  7. spartikus
    Member
    Posted 7 years ago #

    netMASA & arboltsef,

    Did you use WP-Manage to upgrade to 2.1?

  8. netMASA
    Member
    Posted 7 years ago #

    no. I didn't

  9. MichaelH
    Member
    Posted 7 years ago #

    MySQL version should be 4.0 or higher. Is that the problem?

    http://wordpress.org/about/requirements/

  10. arboltsef
    Member
    Posted 7 years ago #

    WP-Manage? how does it help to solve the problem? (googling right away).

    MichaelH, my version of SQL is 4.0.26
    PHP Version 4.3.11.

  11. spartikus
    Member
    Posted 7 years ago #

    It doesn't solve the problem. I thought it might have caused the problem.

    I reinstalled manually as well, following the instructions scrupulously, and the same thing happens.

  12. Trent Adams
    Member
    Posted 7 years ago #

    The blogroll call for 2.1 is a little different than on previous versions. Try something like this in your sidebar instead of what you have:

    <?php wp_list_bookmarks('title_after=&title_before='); ?>

    or simply just:

    <?php wp_list_bookmarks(); ?>

    Trent

  13. arboltsef
    Member
    Posted 7 years ago #

    Well, that could solve the problem in the side bar.

    But when I click Blogroll, in the admin panel, it gives me this error:

    WordPress database error: [Table 'arbolts_wp.att_link2cat' doesn't exist]
    SELECT category_id FROM att_link2cat WHERE link_id = 507 ORDER BY category_id

    WordPress database error: [Table 'arbolts_wp.att_link2cat' doesn't exist]
    SELECT category_id FROM att_link2cat WHERE link_id = 506 ORDER BY category_id

    ...

    The errors that get netMASA in his first post, happen when I try to add a new link.

    I was wondering, I had a category called "links" before doing the upgrade and now it's gone. It has anything to do with whats happening?

    Also, when I check "Categories", in the admin panel... it doesn´t state a default category for links. Is it part of the problem?

  14. foolswisdom
    Moderator
    Posted 7 years ago #

    The issue is that your database is not being updated. You do not have the 2.1 tables and columns. The database upgrade is triggered based only the installed files and then running upgrade, so be sure that all of the WordPress files have been installed.

  15. netMASA
    Member
    Posted 7 years ago #

    Alright, I reinstalled. Then I updated and I got the same thing again

  16. spartikus
    Member
    Posted 7 years ago #

    I've reinstalled manually 2x now - errors remain. upgrade.php was very quick. Is it supposed to be?

  17. spencefhs
    Member
    Posted 7 years ago #

    I have a similar error with my database, and have gone through many of the same steps.

    Any thought on how to resolve. This is an important issue - I have a very busy site (2,500+ posts and 15,000 - 25,000 visitors per week).

    I need to resolve ASAP.

    Thanks

  18. LSRN94
    Member
    Posted 7 years ago #

    I experienced the very same issue upgrading 2.0.5 to 2.1-Ella last night. I've since reverted back to the 2.0.5 version, however after running the upgrade - the necessary database updates were not made.

    The server is running the necessary PHP (4.4.1) and MYSQL (4.0.27-standard) versions.

    I deleted the necessary files first:
    /wp-admin
    /wp-includes
    wp-*.php files;
    EXCEPT wp-config.php

    I then uploaded the new 2.1 files

    I executed the upgrade by going to /wp-admin/upgrade.php which ran for less than a second. then went to my Admin panel and the errors started.

    Going to the WRITE tab - the box on the right displaying the categories showed:

    [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

    Going to the LINKS tab - the links displayed fine, however none of the links were assigned to a category. Additionally, when going into edit a link - the category box displayed the above error, and when trying to edit the link - same thing.

    On the blog itself, the links list does not display, instead, I saw this error:

    WordPress database error: [Table 'mydb_wp.wp_link2cat' doesn't exist]
    SELECT category_id FROM wp_link2cat WHERE link_id = 109 ORDER BY category_id
    WordPress database error: [Table 'mydb_wp.wp_link2cat' doesn't exist]
    SELECT category_id FROM wp_link2cat WHERE link_id = 109 ORDER BY category_id

    I had performed a brand new installation on a subdomain, in order to compare the two databases. The brand new install has no issues and the db tables were built perfectly. When I compared the two databases, however, it was clear that the database updates were not made during the upgrade process.

    Backups are a good thing! :)

    Planning on trying this again on another site I have (one that gets little to no traffic) and see if I experience the same issue.

  19. arboltsef
    Member
    Posted 7 years ago #

    foolwisdom, I deleted all the files (including mods) and uploaded them all.

    The error still persists.

    I have a backup also... so I'm not that worried. Backups are a good thing ;)

  20. LSRN94
    Member
    Posted 7 years ago #

    Just an update to my entry above.. as mentioned, I had downgraded back to 2.0.5 after the initial upgrade failed.

    Today, I went through my plugins and made sure all were deactivated. I also had plugins in there that I haven't been using at all... those plugins also still had tables in my database that weren't being used.. so I deleted those plugins and the associated db tables. The plugins specifically were:

    Short Stats
    Fire Stats
    Feed Stats

    After I did all that, I backed up, ran the upgrade and didn't experience any of the problems I noted above. It all went just as it should, with zero issues.

    I don't know if those plugins (and assoc. tables) were an issue in the first instance... or if I just chose a bad time to run the upgrade (i.e. 2-3 am is right when our servers perform server-wide backups)... no clue. It's still a mystery, however I have upgraded 4 other sites since then and this issue has not been duplicated.

  21. Samuel B
    moderator
    Posted 7 years ago #

    It seems quite a few folks are having problems with Akismet (default plugin with install). Please be sure you deactivate it before the upgrade and that you have the latest version installed after upgrade before activating it again.

  22. arboltsef
    Member
    Posted 7 years ago #

    Ummm, I also have firestats. I'll do the downgrade right away, to see if that helps to solve the problem.

  23. arboltsef
    Member
    Posted 7 years ago #

    Yup, it's a matter of disabling all the plugins before doing the upgrade. That solved the problem in my case.

    I had to erase the tables of firestats, and also, I erased the table of bad-behavior, just in case.

    It's working... it's alive!!! I love this 2.1 version! I really do.

  24. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Yes, there's a reason that the update procedures always say to disable plugins first. Really. :)

  25. netMASA
    Member
    Posted 7 years ago #

    Doesn't work. I disabled all plugins, and everything. And I got nothing.

  26. comA
    Member
    Posted 7 years ago #

    I've definitely deactivated all plugins before the upgrade procedure. But still get a sql error in my sidebar.

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
    SELECT cat_id, cat_name FROM

    No Plugins from above were installed...
    How can i check that the DB upgrade was done?

    PHP Version: 4.4.4
    mySQL: 5.0.27

  27. netMASA
    Member
    Posted 7 years ago #

    I deleted plugin option stuff from the sql database that I don't use any more, checked, repaired and optimised any table that could so apply, and upgraded and...nothing happened.

    I still have the same error.

  28. LSRN94
    Member
    Posted 7 years ago #

    Yes, there's a reason that the update procedures always say to disable plugins first. Really. :)

    Just wanted to clarify - - the plugins I mentioned above : Fire Stats, Short Stats and Feed Stats.. WERE deactivated during my first upgrade attempt. It wasn't until after I dumped their tables in the DB that the upgrade actually took for me. :)

  29. spartikus
    Member
    Posted 7 years ago #

    I dumped plugin tables too, and no luck.

  30. spartikus
    Member
    Posted 7 years ago #

    Fixed! I did it by following the instructions on this thread

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags