Announcement

Collapse
No announcement yet.

MySQL error on Crashed Site

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

  • #16
    As the admin panel works check the following lines of code in /global.php
    between
    PHP Code:
    cachetemplates($templatesused); 
    and
    PHP Code:
    $permissions=getpermissions(); 
    if you see no reference to close then check your phpinclude template.
    Scott MacVicar

    My Blog | Twitter

    Comment


    • #17
      Here are the lines of code between those two lines in global.php:
      Code:
      $newpmmsg=0;
      $headnewpm='';
      if ($checknewpm and $bbuserinfo['userid']!=0 and $bbuserinfo['pmpopup']==2) {
        if ($noshutdownfunc) {
      	$DB_site->query("UPDATE user SET pmpopup=1 WHERE userid=$bbuserinfo[userid]");
        } else {
      	$shutdownqueries[]="UPDATE LOW_PRIORITY user SET pmpopup=1 WHERE userid=$bbuserinfo[userid]";
        }
        $newpmmsg=1;
        eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
      }
      $header='';
      $footer='';
      // parse PHP include ##################
      eval(gettemplate('phpinclude',0,0));
      // parse css, header & footer ##################
      eval("\$headinclude = \"".gettemplate('headinclude')."\";");
      eval("\$header .= \"".gettemplate('header')."\";");
      eval("\$footer .= \"".gettemplate('footer')."\";");
      // parse other global templates
      eval("\$gobutton = \"".gettemplate('gobutton')."\";");
      $timediff='';
      if ($bbuserinfo['timezoneoffset']!=0) {
        if (abs($bbuserinfo['timezoneoffset'])==1) {
      	$timediff=" $bbuserinfo[timezoneoffset] hour";
        } else {
      	$timediff=" $bbuserinfo[timezoneoffset] hours";
        }
      }
      $timenow=vbdate($timeformat,time());
      eval("\$timezone = \"".gettemplate('timezone')."\";");
      // end prepare default templates ********************
      // check to see if server is too busy. this is checked at the end of session.php
      if ($servertoobusy AND $bbuserinfo['usergroupid'] != 6) {
        $useforumjump = 0; // If load limiting options stop us, we aren't including sessions.php which breakes permissions
        eval("standarderror(\"".gettemplate('error_toobusy')."\");");
        exit;
      }
      And here is the template phpinclude:
      Code:
      ob_start();
      chdir("/hsphere/local/home/survivor/boards.survivoraddicts.com/"); 
      require("chat_activity.php");
      chdir("/hsphere/local/home/survivor/boards.survivoraddicts.com/");
      $execute_script = ob_get_contents();
      ob_end_clean();
      chat_activity is in reference to phpMyChat from phpHeaven.

      Comment


      • #18
        ok just to test remove all the contents of the phpinclude template and try that.
        Scott MacVicar

        My Blog | Twitter

        Comment


        • #19
          just downloaded
          phpMyChat
          open connected_users.lib.php and remove
          PHP Code:
           $DbLink->Close(); 
          that should stop it from closing your database connection.
          Scott MacVicar

          My Blog | Twitter

          Comment


          • #20
            Originally posted by Scott MacVicar
            just downloaded
            phpMyChat
            open connected_users.lib.php and remove
            PHP Code:
             $DbLink->Close(); 
            that should stop it from closing your database connection.
            OK... I deleted the contents of phpinclude and the site came back.

            I then put it back... and deleted $DbLink->Close(); from the connected_users.lib.php and the errors returned.

            The good news is, my users can use the board again.

            The bad news is, I can't include that file to show people who is chatting.

            Any idea what I can do here, Scott? I am VERY grateful for your help so far.

            -Sam

            Comment


            • #21
              Sam, if you can't include that file to show who is chatting, my advice is you check over at http://www.vbulletin.org

              They have quite a few codehacks that utilize phpmychat.

              I'm sure you'll find one that will work for you.
              ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
              Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment

              Comment


              • #22
                OK... got it working as I posted above... but the db was backed up to an earlier time.

                So... I restored the most recent and we are back to square one. Now I cannot get any response from anything that has to connect to the MySQL server. Everything is the same vague error:

                There seems to have been a slight problem with the SurvivorAddicts.com database.
                Please try again by pressing the refresh button in your browser.
                An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.
                We apologise for any inconvenience.


                I checked via phpMyAdmin and the session table says that it is "in use". We were at this point earlier and somehow got past it. I do not remember for the life of me how we did this.

                Any thoughts?

                Steve, I will PM you username and password info.
                Last edited by Cygnus; Sat 29th Mar '03, 11:04pm.

                Comment


                • #23
                  Ah... and anything I try to do in phpMyAdmin with the sessions table results in this error in phpMyAdmin:

                  Can't open file: 'session.MYD'. (errno: 145)

                  I thought about dropping the table and then rebuilding it but not sure about potential pitfalls. Anyone?

                  Comment


                  • #24
                    what version of phpmyadmin are u using? If you have at least 2.3, I think you should just login, click select all for the tables, and click repair. See if that helps any.
                    ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
                    Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment

                    Comment


                    • #25
                      2.2.4

                      I am running the repair and it is working. I just repaired sessions and it started working. I have been able to post but I am running into other database errors. I will repair again and post all errors I get.

                      Comment


                      • #26
                        I'm not sure if there is a repair function, but might as well select them all and repair.
                        ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
                        Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment

                        Comment


                        • #27
                          OK... this is odd...

                          I repaired everything and it all showed status OK.

                          I went to the main page. Fine.

                          I went into one forum. No problem.

                          Looked at a thread. No problem.

                          Went back to main page. No problem.

                          Went into a different forum. No problem.

                          Click on the top thread. Error:

                          Database error in vBulletin 2.2.8:
                          Invalid SQL: SELECT COUNT(*) AS posts FROM post WHERE post.threadid='9284' AND post.visible=1
                          mysql error: Can't find record in 'post'
                          mysql error number: 1032
                          Date: Saturday 29th of March 2003 11:32:17 PM
                          Script: http://boards.survivoraddicts.com/sh...&threadid=9284
                          Referer: http://boards.survivoraddicts.com/fo...?s=&forumid=40

                          So I go into phpMyAdmin and look at this post with threadid='9284'. Everything looks normal.

                          All other threads and posts work, it seems. That one doesn't.

                          Thoughts?

                          Comment


                          • #28
                            well if you reimported, you could try updating your forums information in the admin cp.

                            ACP --> Update Counters..


                            Usually an import may leave lingering threads and/or broken links.

                            Hopefully this will solve something


                            Also, I got this error when visiting that page.
                            Warning: MySQL: Unable to save result set in /hsphere/local/home/survivor/boards.survivoraddicts.com/admin/db_mysql.php on line 93
                            Last edited by ManagerJosh; Sun 30th Mar '03, 12:00am.
                            ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
                            Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment

                            Comment


                            • #29
                              I re-wrote your phpinclude template so it didn't use chat_activity.php and used the vBulletin functions.

                              It appears the thread entries have no corresponding post entries. Lost during corruption?

                              SELECT * FROM thread LEFT JOIN post ON (post.threadid=thread.threadid) WHERE post.threadid IS NULL

                              shows that there are 44 corrupted threads. You would need to install a backup on another database and extract the missing posts from the backup if they are still there.
                              Scott MacVicar

                              My Blog | Twitter

                              Comment


                              • #30
                                Okay - I am experiencing exactly the same issue originally reported in this thread after our database crashed this afternoon. Naturally the affected pages are different with ours though.

                                Strange thing is that the database came up again several hours ago, but the errors only just started flooding in ! It's as if my host changed something on the server - will check now !!

                                Any hints would be useful.

                                Database error in vBulletin 2.2.9:
                                Invalid SQL: SELECT COUNT(*) AS threads FROM thread

                                WHERE thread.visible=1 AND 1=1 AND NOT (thread.forumid='1' OR thread.forumid='2' OR thread.forumid='27' OR thread.forumid='32' OR thread.forumid='25' OR thread.forumid='29' OR thread.forumid='4' OR thread.forumid='30') AND thread.lastpost>=1049174108 AND thread.open<>10
                                mysql error: Got error 127 from table handler
                                mysql error number: 1030
                                Database error in vBulletin 2.2.9:
                                Invalid SQL:
                                SELECT

                                thread.threadid
                                FROM thread
                                WHERE thread.forumid = 10
                                AND thread.sticky=0
                                AND thread.visible=1
                                AND sticky=0

                                ORDER BY sticky DESC, lastpost DESC
                                LIMIT 0,25
                                mysql error: Got error 127 from table handler
                                mysql error number: 1030

                                Comment

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