No announcement yet.

Database Error - Need help please

  • Filter
  • Time
  • Show
Clear All
new posts

  • Database Error - Need help please

    Dumb action #1 - I recently tried to repair / optimize tables without turning the board off.
    Dumb action #2 - The repair / optimize process was dragging for a long time and I logged out before it was complete.

    I know, pretty dumb. So now I have a database error on my site and this is what I see after a server reboot.

    Database error in vBulletin 3.8.5:

    Invalid SQL:

    SELECT IF(votenum >= 1, votenum, 0) AS votenum, IF(votenum >= 1 AND votenum != 0, votetotal / votenum, 0) AS voteavg, votetotal, thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, thread.lastpostid, pollid, thread.forumid,, sticky
    , NOT ISNULL(subscribethread.subscribethreadid) AS subscribed, thread.iconid AS threadiconid, iconpath AS threadiconpath, post.pagetext AS preview, threadread.readtime AS threadread, forumread.readtime AS forumread, thread.attach
    FROM vb_thread as thread
    LEFT JOIN vb_subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = 2) LEFT JOIN vb_icon AS icon ON (icon.iconid = thread.iconid) LEFT JOIN vb_post AS post ON (post.postid = thread.firstpostid) LEFT JOIN vb_threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = 2)
    LEFT JOIN vb_forumread AS forumread ON (thread.forumid = forumread.forumid AND forumread.userid = 2)
    WHERE open != 10
    AND thread.visible = 1
    AND (thread.forumid IN(51))
    ORDER BY views DESC
    LIMIT 10;

    How can I repair this database error?

    Thank you,
    Last edited by wzrdsucks; Thu 14 Apr '11, 5:58pm.

  • #2
    To fix this run Repair/Optimize in the Admin CP. You may need to run it more than once to fix all errors:

    Admin CP -> Maintenance -> Repair/Optimize Tables -> Check All -> Continue

    If you cannot access the Admin CP you can also use phpMyAdmin to repair tables.

    If that doesn't work then this may be too damaged to fix with the normal methods. Please check out this thread for other ways to repair a db, particularly items #2 and 3:

    You may have to ask your host to try and repair this for you.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography

    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    • #3
      Thank you, my host was able to assist me with repairing and optimizing the tables.


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.