DB errors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jimv8673
    Member
    • Feb 2010
    • 54
    • 4.2.X

    DB errors

    When i try to post a new topic on my VB 4.2.2 forum i get

    Database Error Database error
    The HernboHost Community database has encountered a problem.
    Please try the following:
    Load the page again by clicking the Refresh button in your web browser.
    Open the forums.hernbohost.com home page, then try to open another page.
    Click the Back button to try another link.
    The forums.hernbohost.com forum technical staff have been notified of the error, though you may contact them if the problem persists.

    We apologise for any inconvenience.


    Database error in vBulletin 4.2.2:

    Invalid SQL:

    INSERT INTO postlog
    (postid, useragent, ip, dateline)
    VALUES
    (45, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36', 845726182, 1423137430);

    MySQL Error : Duplicate entry '45' for key 'PRIMARY'
    Error Number : 1062
    Request Date : Thursday, February 5th 2015 @ 11:57:10 AM
    Error Date : Thursday, February 5th 2015 @ 11:57:10 AM
    Script : http://forums.hernbohost.com/newthre...ostthread&f=22
    Referrer : http://forums.hernbohost.com/newthre...newthread&f=22
    IP Address : 50.104.193.230
    Username : JIM
    Classname : vB_Database
    MySQL Version : 5.5.40-cll


    Can you please help with this ??
  • starme
    Senior Member
    • Aug 2011
    • 111
    • 4.1.x

    #2
    Try to repair and optimize the table

    Comment

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

      #3
      Originally posted by starme
      Try to repair and optimize the table
      That won't do anything to fix this issue.



      What is the result of this query?

      select max(postid) from postlog

      Translations provided by Google.

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

      Comment

      • jimv8673
        Member
        • Feb 2010
        • 54
        • 4.2.X

        #4
        max(postid)
        50

        Comment

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

          #5
          Somehow the auto-increment is off there. You'll actually need to increase the auto-increment value on the post table to fix this. Follow these steps:

          1) Turn off your forums.
          2) Create a database backup for data security purposes.
          3) Run this query:
          Code:
          SELECT max(postid)+1 FROM POST
          4. Take the result from that query and use it for XX below:
          Code:
          ALTER TABLE post AUTO_INCREMENT=XX
          Translations provided by Google.

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

          Comment

          • jimv8673
            Member
            • Feb 2010
            • 54
            • 4.2.X

            #6
            Ok im kinda a newb here when it comes to getting into the bowels of the beast.

            1. By turning off the forum do you mean log out ? then go into the Admin CP from the url. ?

            2. database backup i get.

            3 Run that query i got.

            4. This is what i dont follow, where is that Code located so i can enter the info ?

            ALTER TABLE post AUTO_INCREMENT=XX ???? thanks up front for all this help
            Last edited by jimv8673; Thu 5 Feb '15, 12:22pm.

            Comment

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

              #7
              Sorry... #4 is a query as well.

              To turn off your forums go into the AdminCP. Then go to Settings -> Options -> Turn your forum on/off. You don't need to logout first.
              Translations provided by Google.

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

              Comment

              • jimv8673
                Member
                • Feb 2010
                • 54
                • 4.2.X

                #8
                Ok, turned off the forum, ran the first query and got this.

                An error occurred while attempting to execute your query. The following information was returned.
                error number: 1146
                error desc: Table 'forumshh_Forum.POST' doesn't exist

                Now what ??

                Comment

                • kh99
                  Senior Member
                  • Aug 2009
                  • 533

                  #9
                  Well, that shouldn't happen. If you didn't have a post table you'd know it. How are you executing the queries? Do you have more than one database? From your first post it doesn't look like you have a table prefix set.

                  Comment

                  • jimv8673
                    Member
                    • Feb 2010
                    • 54
                    • 4.2.X

                    #10
                    Really ?? i actually went to the tables via the phpMyAdmin in the Cpanel, and that table is actually not there, but i dont know how to get it there, and if just adding that table somehow will fix this issue.

                    Comment

                    • kh99
                      Senior Member
                      • Aug 2009
                      • 533

                      #11
                      The post table is where the posts are stored, and you have posts on your forum already, so I don't see how it could be missing. There has to be something else going on.

                      Edit: well, I suppose it's possible that everything being displayed is cached and you are actually missing the post table. Are you able to edit an existing post?

                      Last edited by kh99; Thu 5 Feb '15, 3:56pm.

                      Comment

                      • jimv8673
                        Member
                        • Feb 2010
                        • 54
                        • 4.2.X

                        #12
                        You are right, i checked again and the Post table is there.
                        Is this query string correct ?

                        SELECT max(postid)+1 FROM POST
                        Is any of that case sensitive etc. ??

                        Comment

                        • jimv8673
                          Member
                          • Feb 2010
                          • 54
                          • 4.2.X

                          #13
                          well, i ran a bunch of maintenance tools, in the admincp, and the issue seems to be corrected,

                          i suppose, dont look a gift horse in the mouth, and i also learned a couple of things along the way, ive worked on this issue all day.

                          Comment

                          • jimv8673
                            Member
                            • Feb 2010
                            • 54
                            • 4.2.X

                            #14
                            Thank anyone who replied so much for your efforts

                            Comment

                            Related Topics

                            Collapse

                            Working...