如果你刚接触Discuz 你真的有必要去好好去 胡乱设置并且体验里面的所有功能 
  给你给入门之路的传送门  
  ---------- 
  言归正传! 
  错误排错 
  1L SQL错误 
  2L 插件错误 
  3L 网站空白调试 
   
  排错。本排错不包含服务器原因,服务器配置请留意下一篇. 
  论坛出现故障 
  1 SQL 错误提示,大可以GG翻译一下,  
       其中最前的数字部分 如2003,你们也别当作Discuz 2003什么的错误,其实那是MYSQL错误,大可以百度 "MYSQL 2003" 
   
       以下举例几个经典的  虽然70%是插件数据表丢失,当然DZ还原出错也会导致, 
       [如果插件数据库出问题 要参考插件目录的 install.php  如果不存在  那必须联系插件作者,所以下面的应当理解其方法] 
       does exit信息 那就意味着某个表不存在 解决方式 如 
       'pre_common_syscache' doesn't exist 方法很简单 下载一个当前版本的官网安装包  
  打开install目录 找到install.sql  在里面搜索 ‘common_syscache’【关键字搜索不要一次性复制】 
  找到位置后 
  将其存在的位置整个内容复制去 数据库管理[phpMyAdmin]执行 如 
  CREATE TABLE pre_common_syscache ( 
    cname varchar(32) NOT NULL, 
    ctype tinyint(3) unsigned NOT NULL, 
    dateline int(10) unsigned NOT NULL, 
    `data` mediumblob NOT NULL, 
    PRIMARY KEY (cname) 
  ) TYPE=MyISAM; 
  一般从  'CREATE TABLE pre_common_syscache '到 ; 结束,注意一下的是如果你不是默认前缀 就把pre改成你当前的前缀。  
 
   
 (1054) Unknown column 'sid' in 'where clause' 
  SELECT * FROM common_session WHERE `sid`='x8IS8K' 
   
  这里出现一个 Unknown column 'sid'  
  我们首先去搜索  common_session  相关数据库 
  结果如下 
 DROP TABLE IF EXISTS pre_common_session; 
  CREATE TABLE pre_common_session ( 
  sid char(6) NOT NULL DEFAULT '',   
  ip1 tinyint(3) unsigned NOT NULL DEFAULT '0', 
    ip2 tinyint(3) unsigned NOT NULL DEFAULT '0', 
    ip3 tinyint(3) unsigned NOT NULL DEFAULT '0', 
    ip4 tinyint(3) unsigned NOT NULL DEFAULT '0', 
    uid mediumint(8) unsigned NOT NULL DEFAULT '0', 
    username char(15) NOT NULL DEFAULT '', 
    groupid smallint(6) unsigned NOT NULL DEFAULT '0', 
    invisible tinyint(1) NOT NULL DEFAULT '0', 
    `action` tinyint(1) unsigned NOT NULL DEFAULT '0', 
    lastactivity int(10) unsigned NOT NULL DEFAULT '0', 
    lastolupdate int(10) unsigned NOT NULL DEFAULT '0', 
    fid mediumint(8) unsigned NOT NULL DEFAULT '0', 
    tid mediumint(8) unsigned NOT NULL DEFAULT '0', 
    UNIQUE KEY sid (sid), 
    KEY uid (uid) 
  ) TYPE=HEAP;  
 
 我们执行需要执行SQL  :  ALTER  pre_common_session  ADD sid char(6) NOT NULL DEFAULT ''; |