Announcement

Collapse
No announcement yet.

Database Error, Invalid SQL

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

  • Database Error, Invalid SQL

    http://www.socnetcentral.com/vb/private.php

    Can anyone provide any insight into what may be the cause of this problem?

    Database error in vBulletin 3.5.0 Beta 4:
    Invalid SQL:
    SELECT COUNT(*) AS total, folderid
    FROM pm AS pm
    LEFT JOIN pmtext AS pmtext USING(pmtextid)
    WHERE userid = 1090
    GROUP BY folderid;
    MySQL Error : Can't open file: 'pm.MYD'. (errno: 145)
    Error Number : 1016
    Date : Tuesday, July 19th 2005 @ 11:41:47 PM
    Script : http://www.socnetcentral.com/vb/private.php
    Referrer :
    IP Address : 24.126.168.35
    Username : Jeff Rambo
    Classname : vb_database

  • #2
    MySQL error: 145 = Table was marked as crashed and should be repaired

    Your pm table crashed. To fix it, run Repair/Optimize in the Admin CP. You may need to run it more than once to fix all errors:

    Admin CP -> Import & Maintenance -> Repair/Optimize Tables -> Check All -> Continue
    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


    • #3
      OK, I did that and aside from several other warnings, these stood out:

      Error: Can't find file: 'attachmentviews.MYD' (errno: 2)
      pm Check Warning: Table is marked as crashed
      pm Check Warning: 4 clients is using or hasn't closed the table properly
      pm Check Warning: Size of datafile is: 1060864 Should be: 1060851
      pm Check Error: Found 62222 keys of 62221
      pm Check Error: Corrupt
      threadviews Check Warning: Table is marked as crashed
      threadviews Check Warning: 2 clients is using or hasn't closed the table properly
      threadviews Check Error: Can't read key from filepos: 1024
      threadviews Check Error: Corrupt
      word Check Warning: Table is marked as crashed
      word Check Warning: 4 clients is using or hasn't closed the table properly
      word Check Warning: Size of datafile is: 22659072 Should be: 22659048
      word Check Error: Found 419613 keys of 419612
      word Check Error: Corrupt

      What now?

      Comment


      • #4
        You need to keep running repair until all the tables are fixed. You have a severely corrupted database.

        I also strongly recommend you close your forums until this is done to avoid further problems.
        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
          Originally posted by Steve Machol
          You need to keep running repair until all the tables are fixed. You have a severely corrupted database.

          I also strongly recommend you close your forums until this is done to avoid further problems.
          The forums have been turned off for a few hours, yet the currently active section still shows members logged in. Is this normal?

          Comment


          • #6
            Even with the forums turned off, this does not stop people from trying to access them and showing up on the currently active section.
            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


            • #7
              Copy that. Last question, I've ran the repair/optimize tool several times now. It has repaired everything except for this:
              attachmentviews Check Error: Can't find file: 'attachmentviews.MYD' (errno: 2)

              Is there a process I can take to correct that error?

              Comment


              • #8
                You are missing the data file for this table. This seems to happen to the threadviews table along with the attachmentviews table. Run these queries to recreate both of these tables:

                1:
                DROP TABLE IF EXISTS threadviews;

                2:
                CREATE TABLE threadviews (
                threadid INT UNSIGNED NOT NULL DEFAULT '0',
                KEY threadid (threadid)
                );


                3:
                DROP TABLE IF EXISTS attachmentviews;

                4:
                CREATE TABLE attachmentviews (
                attachmentid INT UNSIGNED NOT NULL DEFAULT '0',
                KEY postid (attachmentid)
                );
                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


                • #9
                  I lost thread and attachment views too Would an SQL crash cause that to happen?

                  Comment


                  • #10
                    Yes.
                    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


                    • #11
                      Good that helped me as well.
                      Eagles may soar in the clouds, but weasels never get sucked into jet engines.
                      And on the eighth day God said, "Okay, Murphy, you're in charge!"

                      The early bird gets the worm, but the second mouse gets the cheese.

                      Comment


                      • #12
                        I dont have permission to run SQL queries?

                        Originally posted by Steve Machol
                        You are missing the data file for this table. This seems to happen to the threadviews table along with the attachmentviews table. Run these queries to recreate both of these tables:

                        1:
                        DROP TABLE IF EXISTS threadviews;

                        2:
                        CREATE TABLE threadviews (
                        threadid INT UNSIGNED NOT NULL DEFAULT '0',
                        KEY threadid (threadid)
                        );


                        3:
                        DROP TABLE IF EXISTS attachmentviews;

                        4:
                        CREATE TABLE attachmentviews (
                        attachmentid INT UNSIGNED NOT NULL DEFAULT '0',
                        KEY postid (attachmentid)
                        );
                        How do I allow my server to run SQL queries? And is it done within the server config (I have a dedicated server with FREE BSD and Plesk) or within the VB controlpanel ?

                        I got this problem after my mysql DB crashed when my server's HDD space ran out.

                        Comment


                        • #13
                          You can run queries in phpMyAdmin. 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


                          • #14
                            Hmm

                            I can't find the config.php file in my vbulletin folder. Can you give me its path please? Or you are you referring to a different config file?

                            //matrlx

                            Comment


                            • #15
                              It is in the includes directory.
                              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