处理discuz表崩溃 is marked as crashed之类问题
发布时间:2021-11-29 19:38:31 所属栏目:教程 来源:互联网
导读:此类问题 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,真是头疼,天天要进后台去点击修复,甚至一天要好几次,研究了好久终于
此类问题 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了,操作如下: 。。。。。。。。。。。。。。。。。。。。。。。。 01 public function __construct($para = array()) { 02 if(!empty($para)) { 03 $this->_table = $para['table']; 04 $this->_pk = $para['pk']; 05 } 06 if(isset($this->_pre_cache_key) && (($ttl = getglobal('setting/memory/'.$this->_table)) !== null || ($ttl = $this->_cache_ttl) !== null) && memory('check')) { 07 $this->_cache_ttl = $ttl; 08 $this->_allowmem = true; 09 } 10 $this->repair();//解决表是否崩溃,新加进去的代码 11 $this->_init_extend(); 12 parent::__construct(); 13 } 14 //解决表是否崩溃,新加进去的一个自己检查是否需要修复的代码 15 public function repair() { 16 $query1=DB::query('CHECK TABLE '.DB::table($this->_table)); 17 $checkresult =mysql_fetch_array($query1, MYSQL_ASSOC); 18 //echo(DB::table($this->_table)); 19 //exit; 20 if($checkresult['Msg_text'] != 'OK') { 21 DB::query('REPAIR TABLE '.DB::table($this->_table)); 22 } 23 24 } (编辑:济南站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |