Database Error Number : 1146 when posting a new post !! help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • firassameer
    Member
    • Aug 2011
    • 41
    • 4.1.x

    [Forum] Database Error Number : 1146 when posting a new post !! help

    Dear Guys,

    I had a problem after I transferred my whole forum from one provider to another one, I downloaded the full database backup and with the aid of the new hosting support they imported the whole database into my new location...

    then I uploaded my last vBulletin forum which was 4.1 and upgrade it into 4.2

    Now whenever I tried to post a new thread I fail and an error shown as below:

    Database error in vBulletin 4.2.0:

    Invalid SQL:

    SELECT COUNT(*)
    FROM tag AS tag
    JOIN tagcontent AS tagcontent ON (tag.tagid = tagcontent.tagid)
    WHERE tagcontent.contenttypeid = 2
    AND tagcontent.contentid = 0;

    MySQL Error : Table 'sindbadnew.tag' doesn't exist
    Error Number : 1146
    Request Date : Thursday, June 28th 2012 @ 07:55:31 PM
    Error Date : Thursday, June 28th 2012 @ 07:55:31 PM
    Script : http://gelgamish.com/newthread.php?do=postthread&f=60
    Referrer : http://gelgamish.com/newthread.php?do=newthread&f=60
    IP Address : 86.97.125.16
    Username : ÇáÓäÏÈÇÏ
    Classname : vB_Database
    MySQL Version : 5.1.56-log



    Kindly advice how to solve this issue !!!

    thank you
  • Amaury
    Senior Member
    • Mar 2012
    • 1807
    • 4.2.X

    #2
    Is there anything in your server's error logs? If you can't access them, contact your host.
    Former vBulletin user

    Comment

    • Matthew Gordon
      Senior Member
      • May 2002
      • 3243
      • 1.1.x

      #3
      Your missing the tag table, which means that it is very likely that your database backup was not complete. You can try recreating it with the following query, but you should really make sure that your database backup is complete. If you still have access to your old site, I'd recommend using something like MySQLDumper to take a new backup.

      Here's the query to recreate the table:
      Code:
      CREATE TABLE tag (
      	tagid INT UNSIGNED NOT NULL AUTO_INCREMENT,
      	tagtext VARCHAR(100) NOT NULL DEFAULT '',
      	dateline INT UNSIGNED NOT NULL DEFAULT '0',
      	canonicaltagid INT UNSIGNED NOT NULL DEFAULT '0',
      	PRIMARY KEY (tagid),
      	UNIQUE KEY tagtext (tagtext),
      	KEY canonicaltagid (canonicaltagid)
      )	ENGINE = MyISAM

      Comment

      • firassameer
        Member
        • Aug 2011
        • 41
        • 4.1.x

        #4
        Originally posted by Matthew Gordon
        Your missing the tag table, which means that it is very likely that your database backup was not complete. You can try recreating it with the following query, but you should really make sure that your database backup is complete. If you still have access to your old site, I'd recommend using something like MySQLDumper to take a new backup.

        Here's the query to recreate the table:
        Code:
        CREATE TABLE tag (
            tagid INT UNSIGNED NOT NULL AUTO_INCREMENT,
            tagtext VARCHAR(100) NOT NULL DEFAULT '',
            dateline INT UNSIGNED NOT NULL DEFAULT '0',
            canonicaltagid INT UNSIGNED NOT NULL DEFAULT '0',
            PRIMARY KEY (tagid),
            UNIQUE KEY tagtext (tagtext),
            KEY canonicaltagid (canonicaltagid)
        )    ENGINE = MyISAM


        Thank you Mathew for you help, but to be honest I am not so familiar with the Database stuff and/db tables hence I don't know where should I post this code...

        Another thing to mention is the database backup I restored it with the aid of the new hosting staff, I provided them with two files one if localhost.aql and the other is schema.aql or something like that.... do you think they might missed restoring the schema? if I try to restore my schema again would this solve the issue?

        Or should I simply post the above code? (need a hint on how to do that)

        please advice..

        Comment

        • Wayne Luke
          vBulletin Technical Support Lead
          • Aug 2000
          • 74111

          #5
          You would enter the above code in a query window using a tool such as phpMyAdmin. Then you execute the query to update the database. If you don't know how to run a query, your hosting provider should be able to do this for you.
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud demonstration site.
          vBulletin 5 API

          Comment

          • firassameer
            Member
            • Aug 2011
            • 41
            • 4.1.x

            #6
            Originally posted by Wayne Luke
            You would enter the above code in a query window using a tool such as phpMyAdmin. Then you execute the query to update the database. If you don't know how to run a query, your hosting provider should be able to do this for you.

            Thank you Wayne, I have performed this code into the query of mysql and it did created the table you mentioned, BUT when I tested the new post again this an error shown as below:

            Database error in vBulletin 4.2.0:

            Invalid SQL:

            SELECT COUNT(*)
            FROM tag AS tag
            JOIN tagcontent AS tagcontent ON (tag.tagid = tagcontent.tagid)
            WHERE tagcontent.contenttypeid = 2
            AND tagcontent.contentid = 0;

            MySQL Error : Table 'sindbadnew.tagcontent' doesn't exist
            Error Number : 1146
            Request Date : Friday, June 29th 2012 @ 12:55:18 PM
            Error Date : Friday, June 29th 2012 @ 12:55:19 PM
            Script : http://gelgamish.com/newthread.php?do=postthread&f=44
            Referrer : http://gelgamish.com/newthread.php?do=newthread&f=44
            IP Address : 86.97.125.16
            Username : السندباد
            Classname : vB_Database
            MySQL Version : 5.1.56-log


            Kindly advice..

            regards

            Comment

            • Wayne Luke
              vBulletin Technical Support Lead
              • Aug 2000
              • 74111

              #7
              As Matthew said above your database backup is most likely incomplete. Soon you could be missing important threads like thread and user. The only other reason you would miss these tables is that you're using newer vBulletin files on an old version of the database and haven't run the upgrade.php file.

              Do you still have access to the old database? You should make a new backup and reimport it. When making a database backup, everything should be in one single SQL file. This includes all data and table definitions.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API

              Comment

              • firassameer
                Member
                • Aug 2011
                • 41
                • 4.1.x

                #8
                Originally posted by Wayne Luke
                As Matthew said above your database backup is most likely incomplete. Soon you could be missing important threads like thread and user. The only other reason you would miss these tables is that you're using newer vBulletin files on an old version of the database and haven't run the upgrade.php file.

                Do you still have access to the old database? You should make a new backup and re import it. When making a database backup, everything should be in one single SQL file. This includes all data and table definitions.

                Yes Mathew, I am still able to access my old database, and it was not easy to import it into the new database via the aid of the new hosting support staff, they tried this many times till they made it work...

                When they imported the database successfully, I uploaded the old vbulletn 4.1 into the new hosting, then I uploaded the new version 4.2 and executed the upgrade.php ... the forum then run normally ..

                Now as I mentioned earlier, I discovered the posting issue, I created the table as per the code above but still the issue is there...

                You are suggesting to upload the old database again while at the beginning when I was trying doing that error messages were showing to me, but the support staff helped me with that .. so I doubt it is a good idea for me to try uploading it again...

                Is there any other way I can do it? or is there someone would access my account and fix it for me!! I would appreciate that so much ...

                Greetings..

                Comment

                • Wayne Luke
                  vBulletin Technical Support Lead
                  • Aug 2000
                  • 74111

                  #9
                  The first issue is resolved. This is a different missing table, tagcontent.

                  The code to recreate this table would be:
                  Code:
                  CREATE TABLE tagcontent (
                      tagid INT UNSIGNED NOT NULL DEFAULT 0,
                      contenttypeid INT UNSIGNED NOT NULL,
                      contentid INT UNSIGNED NOT NULL DEFAULT '0',
                      userid INT UNSIGNED NOT NULL DEFAULT '0',
                      dateline INT UNSIGNED NOT NULL DEFAULT '0',
                      PRIMARY KEY tag_type_cid (tagid, contenttypeid, contentid),
                      KEY id_type_user (contentid, contenttypeid, userid),
                      KEY user (userid),
                      KEY dateline (dateline)
                  )    ENGINE = MyISAM
                  Translations provided by Google.

                  Wayne Luke
                  The Rabid Badger - a vBulletin Cloud demonstration site.
                  vBulletin 5 API

                  Comment

                  • firassameer
                    Member
                    • Aug 2011
                    • 41
                    • 4.1.x

                    #10
                    Originally posted by Wayne Luke
                    The first issue is resolved. This is a different missing table, tagcontent.

                    The code to recreate this table would be:
                    Code:
                    CREATE TABLE tagcontent (
                        tagid INT UNSIGNED NOT NULL DEFAULT 0,
                        contenttypeid INT UNSIGNED NOT NULL,
                        contentid INT UNSIGNED NOT NULL DEFAULT '0',
                        userid INT UNSIGNED NOT NULL DEFAULT '0',
                        dateline INT UNSIGNED NOT NULL DEFAULT '0',
                        PRIMARY KEY tag_type_cid (tagid, contenttypeid, contentid),
                        KEY id_type_user (contentid, contenttypeid, userid),
                        KEY user (userid),
                        KEY dateline (dateline)
                    )    ENGINE = MyISAM

                    Thank you Wayne for your support, I incoded this table as well, and then I tried to post a test post I got this error:

                    Network Error (tcp_error)

                    A communication error occurred: ""
                    The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.

                    before that I tried to preview my post before posting, the same error appears..

                    Please advice..

                    Comment

                    • Wayne Luke
                      vBulletin Technical Support Lead
                      • Aug 2000
                      • 74111

                      #11
                      That is a server error and only your hosting provider can help with that. I suspect it might be related to mod_security, mod_security2 or Suhosin configurations on your server.
                      Last edited by Wayne Luke; Fri 29 Jun '12, 11:04am.
                      Translations provided by Google.

                      Wayne Luke
                      The Rabid Badger - a vBulletin Cloud demonstration site.
                      vBulletin 5 API

                      Comment

                      • firassameer
                        Member
                        • Aug 2011
                        • 41
                        • 4.1.x

                        #12
                        Originally posted by Wayne Luke
                        That is a server error and only your hosting provider can help with that. I suspect it might be related to mod_security, mod_security2 or Suhosin configurations on your server.

                        Thank you Wayne, just wanted to add what happened next to that to see what would you think from your own experience ..

                        After that previous error shown, I refreshed the page I got this error:

                        Database error in vBulletin 4.2.0:

                        Invalid SQL:
                        INSERT INTO searchgroup (username, contenttypeid, groupid, userid, dateline)
                        VALUES ( '', 3, 44, 0, 1340999749 )
                        ON DUPLICATE KEY UPDATE username = VALUES(username), contenttypeid = VALUES(contenttypeid), groupid = VALUES(groupid), userid = VALUES(userid), dateline = VALUES(dateline);

                        MySQL Error : Table 'sindbadnew.searchgroup' doesn't exist
                        Error Number : 1146
                        Request Date : Friday, June 29th 2012 @ 03:55:49 PM
                        Error Date : Friday, June 29th 2012 @ 03:55:58 PM
                        Script : http://al-sindbad.com/newthread.php?do=postthread&f=44
                        Referrer : http://al-sindbad.com/newthread.php?do=newthread&f=44
                        IP Address : 86.97.125.16
                        Username : السندباد
                        Classname : vB_Database
                        MySQL Version : 5.1.56-log


                        Then, I opened the website from the domain, and went to the same forum to try posting again AND guess what !!! I found the two posts where there!! that I suppose to have error when I tried to post them ... It was simply there !!!!???


                        Then the strangest thing is when I tried to delete the two posts because they were only for test... I got another error:

                        Database error in vBulletin 4.2.0:

                        Invalid SQL:

                        DELETE searchcore, searchcore_text
                        FROM searchcore AS searchcore JOIN
                        searchcore_text AS searchcore_text ON
                        searchcore.searchcoreid = searchcore_text.searchcoreid
                        WHERE searchcore.groupcontenttypeid = 2 AND
                        searchcore.groupid = 291;

                        MySQL Error : Table 'sindbadnew.searchcore' doesn't exist
                        Error Number : 1146
                        Request Date : Friday, June 29th 2012 @ 03:57:24 PM
                        Error Date : Friday, June 29th 2012 @ 03:57:26 PM
                        Script : http://al-sindbad.com/inlinemod.php?...&threadids=291
                        Referrer : http://al-sindbad.com/login.php?do=login
                        IP Address : 86.97.125.16
                        Username : السندباد
                        Classname : vB_Database
                        MySQL Version : 5.1.56-log



                        Do you have any idea or advice??


                        P.S: You may notice I changed the domain as the first one was temporary for testing, this one is the correct domain..

                        thanks

                        Comment

                        • borbole
                          Senior Member
                          • Feb 2010
                          • 3074
                          • 4.0.0

                          #13
                          It looks like your database backup that was restored was incomplete seeing how you get one missing table after the other error messages. if you still have access to the database in the old host, make a new backup and make sure that it is done properly and import it to the new host. Or let the new host do the backup of the db at the old host.

                          P.s. How big is your database and what method did you use to export it?

                          Comment

                          • Wayne Luke
                            vBulletin Technical Support Lead
                            • Aug 2000
                            • 74111

                            #14
                            Yeah.. This is another missing table. As you still have access to the old database, it would probably be easier to create a new database backup. Some of these tables can contain critical data.
                            Translations provided by Google.

                            Wayne Luke
                            The Rabid Badger - a vBulletin Cloud demonstration site.
                            vBulletin 5 API

                            Comment

                            • firassameer
                              Member
                              • Aug 2011
                              • 41
                              • 4.1.x

                              #15
                              Thank you Wayne and Borbole,

                              My Database size around 75 MB, do you think that importing the old data is the only solution? I believe it was so hard to made the restoring work again when the new host support staff restored it for me... every time they restored the database missing tables where there.. my old database had around 216 tables, when they restored it for the first time the new database was only around 195 tables, then they restored it again (I gave them the access info to my old account and they downloaded the DB directly by themselves and restored it for me) then again a couple of missing tables where there, then I don't know how did they fix it into a new database again making the forum working again after I upgraded to 4.2 ...

                              Now, I feel frustrated when someone ask me to restore it again because that restoring thing took up to 2 days of continuous correspondence with the support staff till they restored it successfully .. that's why I am wondering if there is another way like to add those missing tables manually just I did recently thankfully by your help guys ..


                              P.S.: I guess its important to mention that the reason why I left the old hosting because I got my forum get hacked and destroyed, then using the weekly backup the old host support restored it back BUT it was still infected by spams and spammy registered users..., now I made some security tricks to secure the forum.. Maybe some database tables were damaged because of that which causes this problem ... but as far as I remember till the last moment there I was able to post normally in the forum and use it normally..

                              Please advice ...
                              Last edited by firassameer; Fri 29 Jun '12, 2:50pm.

                              Comment

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