Database error when creating thread

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rocky777
    Senior Member
    • May 2009
    • 125
    • 4.0.x

    [Answered] Database error when creating thread

    Hello,

    I have a probblem, when I try to create a thread I got the following database error:

    Database error in vBulletin 4.2.0:

    Invalid SQL:

    SELECT t.tagtext, p.tagtext as canonicaltagtext
    FROM tag t JOIN
    tag p ON t.canonicaltagid = p.tagid
    WHERE t.tagtext IN ('');

    MySQL Error : Table 'databasename.tag' doesn't exist
    Error Number : 1146
    Request Date : Friday, May 24th 2013 @ 06:00:06 PM
    Error Date : Friday, May 24th 2013 @ 06:00:08 PM
    Script : http://www.#/forum/newthread.php?do=postthread&f=11
    Referrer : http://www.#/forum/newthread.php?do=newthread&f=11
    IP Address :#
    Username : #
    Classname : vB_Database
    MySQL Version : 5.1.68-cll




    My vB version is 4.2.0 patch level 3.

    One hour ago i tried to upgrade to upgrade to 4.2.1, but I did a mistake and then I asked my host to restore a backup.

    Before that everything was ok, I had no problem's but now I can't create any new threads because I receive that error.

    So I'm asking now for some help, can someone tell me how to fix this?
    Last edited by Rocky777; Thu 30 May '13, 1:48am.
  • Hartmut
    Senior Member
    • Nov 2007
    • 2870
    • 4.2.x

    #2
    Did you already check if the table 'tag' is available? Maybe something went wrong with the restore and this table is missing now?
    No private support, only PM me when I ask for it. Support in the forums only.

    Comment

    • Rocky777
      Senior Member
      • May 2009
      • 125
      • 4.0.x

      #3
      The table 'tag' it's not available, I looked in the database and it's not there. What I should do, I must create this manually?

      Comment

      • Hartmut
        Senior Member
        • Nov 2007
        • 2870
        • 4.2.x

        #4
        Before you run this query, please make sure that you have a working backup of your database.
        PHP Code:
        CREATE TABLE {here_your_tableprefix}tag (
        tagid INT UNSIGNED NOT NULL AUTO_INCREMENT,
        tagtext VARCHAR(100NOT 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
        No private support, only PM me when I ask for it. Support in the forums only.

        Comment

        • Rocky777
          Senior Member
          • May 2009
          • 125
          • 4.0.x

          #5
          I tried that but I got another error:

          "#1064 - 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 '{here_your_tableprefix}tag ( tagid INT UNSIGNED NOT NULL AUTO_INCREMENT, tagte' at line 1"

          What to do now?

          Comment

          • Mark.B
            vBulletin Support
            • Feb 2004
            • 24286
            • 6.0.X

            #6
            You need to change {here_your_tableprefix}, to your table prefix, if you have one.

            If you don't, then it's just:
            PHP Code:
            CREATE TABLE tag (
            tagid INT UNSIGNED NOT NULL AUTO_INCREMENT,
            tagtext VARCHAR(100NOT 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
            MARK.B
            vBulletin Support
            ------------
            My Unofficial vBulletin 6.0.0 Demo: https://www.talknewsuk.com
            My Unofficial vBulletin Cloud Demo: https://www.adminammo.com

            Comment

            • Rocky777
              Senior Member
              • May 2009
              • 125
              • 4.0.x

              #7
              I don't have a table prefix, I run the query and now this : #1050 - Table 'tag' already exists

              I checked again the database and the table it's not there.

              Comment

              • BirdOPrey5
                Senior Member
                • Jul 2008
                • 9613
                • 5.6.3

                #8
                You should contact your host- there seems to be a problem with the backup. Let them know you can't see the tag table in the list but MySQL reports it is there if you try to recreate it.

                Comment

                • Rocky777
                  Senior Member
                  • May 2009
                  • 125
                  • 4.0.x

                  #9
                  Ok thanks. I just emailed them and I hope they will help.

                  Comment

                  • Rocky777
                    Senior Member
                    • May 2009
                    • 125
                    • 4.0.x

                    #10
                    Everything works now, I found a old database backup that was good and I restored this into a new database. Thanks to everyone who replied in this thread.

                    Comment

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