此类问题 is marked as crashed and last (automatic?) repair failedDELETE FROM security_failedlog WHERE pid = 0 AND tid = 0 AND uid = 0 OR lastfailtime = 0 OR failcount >= 10,真是头疼,天天要进后台去点击修复,甚至一天要好几次,研究了好久终于解决了,方法很简单,一劳永逸,打开discuz_table.php,在这里加入自动检查修复的一段代码就ok了,操作如下:
。。。。。。。。。。。。。。。。。。。。。。。。
public function __construct($para = array()) {
                if(!empty($para)) {
                        $this->_table = $para['table'];
                        $this->_pk = $para['pk'];
                }
                if(isset($this->_pre_cache_key) && (($ttl = getglobal('setting/memory/'.$this->_table)) !== null || ($ttl = $this->_cache_ttl) !== null) && memory('check')) {
                        $this->_cache_ttl = $ttl;
                        $this->_allowmem = true;
                }
        $this->repair();//解决表是否崩溃,新加进去的代码
                $this->_init_extend();
                parent::__construct();
        }
    //解决表是否崩溃,新加进去的一个自己检查是否需要修复的代码
        public function repair() {
      $query1=DB::query('CHECK TABLE '.DB::table($this->_table));
          $checkresult =mysql_fetch_array($query1, MYSQL_ASSOC);
      //echo(DB::table($this->_table));
          //exit;                                
          if($checkresult['Msg_text'] != 'OK') {
          DB::query('REPAIR TABLE '.DB::table($this->_table));
                 }
                
        }

声明:有的资源均来自网络转载,版权归原作者所有,如有侵犯到您的权益 请联系邮箱:123456@qq.com 我们将配合处理!

原文地址:解决discuz表崩溃 is marked as crashed之类问题发布于2023-06-20 10:40:01

相关推荐