Support » Installing WordPress » MySQL error after upgrade to 2.1

  • My host has WordPress available for automatic install/upgrade. I used their upgrade service (after backing some things up myself just in case) and everything seems to have gone smoothly, apart from this error which displays in the sidebar, under the archives list, where all my links should be (they don’t display):

    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 'ASC' at line 1]
    SELECT * FROM wp_categories WHERE cat_ID > 0 AND link_count > 0 ORDER BY cat_id- ASC

    I am using the veryplaintxt theme.
    The error occurred before I had activated any plugins so it can’t be due to that, I think.

    My post categories display properly in the sidebar, but none of the links, nor their categories, show up.

    http://www.language-global.com/blog

Viewing 15 replies - 1 through 15 (of 17 total)
  • I have a similar problem – received link errors when I upgraded from 2.07 to 2.1. My Link category is no longer available and I cannot add any links to the blog (that is, its in the blog roll but not on the site), when I do I get an error:

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_link2cat WHERE link_id = 1 ORDER BY category_id

    When I edit the bookmark I just added, there is an error listed in the Category box:

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = ‘1’

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = ‘1’

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = ‘1’

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = ‘1’

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = ‘1’

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = ‘1’

    WordPress database error: [Got error 1 from storage engine]
    SELECT category_id FROM wp_categories, wp_link2cat WHERE wp_link2cat.category_id = cat_ID AND wp_link2cat.link_id = ‘1’

    Would deleting my link categories fix this problem? And if so, how do I do that exactly? I am running WP version 2.1, PHP 5.2 and MySQL 4.1.22. I have no idea how to use a phpMyAdmin type program but this is on my own server so I have access to the MySQL command prompt.

    Yes, it would be useful to know if deleting all the links and link categories and re-entering them in 2.1 would solve the problem.

    It seems like link categories and post categories are no longer differentiated from each other.

    Also, I have a page which seems to have been added to a post category as a post, not a page.

    As above : http://www.language-global.com/blog

    That solution is not practical for me as I do not run my own server.

    Is there any way to get the link categories and the links to display in the sidebar as before, without having to roll-back (my provider will do the rollback for me, but I have to pay for the service)?

    re: rollback : I have seen posts on this board about people even having errors after rolling back. So I feel like I’m stuck with a buggy wordpress and can’t do anything about it.

    🙁

    Looking at the error message again, I think I may have hit on something:::

    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 'ASC' at line 1]
    SELECT * FROM wp_categories WHERE cat_ID > 0 AND link_count > 0 ORDER BY cat_id- ASC

    Surely the ORDER BY cat_id- ASC should be ORDER BY cat_id ASC ??

    My error is similar. I also have no access to the database, as I am hosted on Lunarpages. Here it is:

    [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

    All the links in my blogroll are gone and I get this message in the 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

    Why did I have to fix something that worked fine? I can’t even go back to 2.07, I have tried, and it doesn’t work
    Please help!!!!

    http://blogginginparis.com

    Most of these type errors are from themes not updated for 2.1. Check your theme author’s website to see if he/she has an update.

    I can’t change the theme. What I would like to do is go back to 2.07 which was OK for me. Could you tell me how to do that?
    Someone helped me with this theme a long time ago. I wouldn’t know how to change it and haven’t got a clue how to change it so that it adapts to 2.1
    What you are telling me is I can’t ever recover my links unless I change the theme.
    I like my theme and don’t really want to change it.
    Why, oh why did I upgrade?

    eija, here suggested a fix that worked.

    After the panic, I managed to fix the problem on my site with the link categories and links not displaying.

    I edited category.php in wp_includes to correct the query. The error message was enough to track down the right place and then it was a question of just adding an
    if ($xxx='id-') { $xxx='ID'; }
    to correct the variable containing the typo.

    After that everything works as it probably should.

    I am having the exact same problem. Benbt-japan – could you elaborate on exactly where to stick:

    if ($xxx=’id-‘) { $xxx=’ID’; }

    Thanks so much.

    Ditto – where in category.php did you put that code? I’m getting the exact same error you did in the exact same theme.

    I think instead of editing core files (always a bad omen) you should update your theme files!
    Most likely the template file displaying your links (sidebar.php?) is using a deprecated template tag; see:
    http://codex.wordpress.org/Template_Tags#Links_Manager_tags

    or, due to the changes in the database, the template tags are pointing to the wrong link category ID#.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘MySQL error after upgrade to 2.1’ is closed to new replies.