Announcement

Collapse
No announcement yet.

Corrupt/Missing Table in Database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Corrupt/Missing Table in Database

    Hi, I am running 3.0.7 and need to move it to another server. When I try to back up the database to the server or by php, I get told:-

    Database error in vBulletin 3.0.7:
    Invalid SQL: SHOW CREATE TABLE vb3_attachmentviews
    mysql error: Can't find file: 'vb3_attachmentviews.MYD' (errno: 2)
    mysql error number: 1017

    - and the back up halts, even if I uncheck the relevant table in the php option - get a partial backup but it stops at the problem table. I don't know how to fix the database, so my question is can I run the install again and recreate the missing table without losing all the data currently in the database. If this will work should I use the original 3.0.7 install files, or upgrade to a later version (my server cannot run 3.6.x). Any help would be much appreciated.

    Thanks, Jon

  • #2
    You can run the following two queries,


    Code:
    DROP TABLE vb3_attachmentviews;
    Code:
    CREATE TABLE vb3_attachmentviews (
    	attachmentid INT UNSIGNED NOT NULL DEFAULT '0',
    	KEY postid (attachmentid)
    );

    Comment


    • #3
      Hi, thanks for your quick reply - when I try to run the 'Run SQL Query' I get told that You are not authorized to execute SQL queries. I am the only administrator and set up the board originally.

      Jon

      Comment


      • #4
        You can run queries in the SQL tab in phpMyAdmin, or to run queries from the Admin CP:

        Admin CP -> Maintenance -> Execute SQL Query -> Manual Query

        Then enter your query in the Manual Query box and click on 'Continue'.

        To run queries you first need to give yourself permission to run queries in the Admin CP. To do this, edit this section of config.php:

        // ****** USERS WITH QUERY RUNNING PERMISSIONS ******
        // The users specified here will be allowed to run queries from the control panel.
        // See the above entries for more information on the format.
        // Please note that the ability to run queries is quite powerful. You may wish
        // to remove all user IDs from this list for security reasons.
        $canrunqueries = 'x';

        ...with x being your userid number.
        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.


        Comment


        • #5
          Hi - thanks, that seems to have nearly fixed it, but I seem to have another missing table further down. The size of the partial back up has increased from 1Mb to 5Mb, so we must be on the right track The message is

          Database error in vBulletin 3.0.7:
          Invalid SQL: SHOW CREATE TABLE vb3_threadviews
          mysql error: Can't find file: 'vb3_threadviews.MYD' (errno: 2)

          mysql error number: 1017

          Can you give me the queries to fix this one?

          Jon

          Comment


          • #6
            Code:
            DROP TABLE vb3_threadviews;
            Code:
            CREATE TABLE vb3_threadviews (
            	threadid INT UNSIGNED NOT NULL DEFAULT '0',
            	KEY threadid (threadid)
            );

            Comment


            • #7
              You should upgrade to at least 3.0.17 immediately for security reasons. To eliminate problems with those tables, upgrade to 3.6.5.
              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.


              Comment


              • #8
                All fixed and backup complete - thank you for such excellent customer support!

                Cheers

                Jon

                Comment


                • #9
                  Originally posted by Steve Machol View Post
                  You should upgrade to at least 3.0.17 immediately for security reasons. To eliminate problems with those tables, upgrade to 3.6.5.
                  OK, thanks for the tip, I will upgrade ASAP. Unfortunately the current server's PHP/SQL configuration won't support 3.6.x, but hopefully they will upgrade soon.

                  Thanks again

                  Jon

                  Comment


                  • #10
                    You will likely be able to upgrade to 3.5.8.
                    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.


                    Comment

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