Warning: Undefined array key "night" in /www/wwwroot/dhaomu.com/wp-content/themes/b2/header.php on line 18

Discuz表不存在的解决方法

discuz教程:Discuz!表不存在的解决方法!很多站长突然发现自己的站打开报错1146,就不知道该怎么办了。

discuz教程:Discuz!表不存在的解决方法!很多站长突然发现自己的站打开报错1146,就不知道该怎么办了。

最常见的报错表是以下2个:

[1146] Table 'sqla1212142518.common_session' doesn't exist
[1146] Table 'sqlshou277.common_cron' doesn't exist

其实你认不认识这些英语没关系,只要知道大概什么意思就行,下面我解释下:

Table:数据表。

sqla1212142518 /sqlshou277:这2个是数据库名,一般就是自己的数据库,记住在单引号开头的是数据库名就行。
common_session/common_cron:这2个是数据表,也就是需要重建的表。
doesn't exist:不存在。如果不认识这2个单词可以使用在线翻译。

知道这些了就容易了,哪个表不存在就重建哪个,当然这2个表里没有重要数据,重建就行,如果是member或者post表不存在那就得恢复数据了,否则就会导致没有会员或者帖子。

首先下载和自己论坛版本对应的标准程序,解压之后,打开\upload\install\data\install.sql的文件。CTRL+F搜索报错的表名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;

其实第一行可以不要,不过无所谓,这句代码的意思是如果这个表存在则删除,反正已经没有了。

注意:如果你的表前缀不是默认的pre_,那么需要把建表语句的pre_替换成你正在用的表前缀。复制建表语句,进入phpmyadmin,随便点一个表,点击SQL,粘贴建表语句,点执行即可。

温馨提示:
1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:duhaomu@163.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明

给TA赞赏
共{{data.count}}人
人已赞赏
编程技巧

织梦后台文章编辑器一片空白解决方法

2020-10-28 0:00:00

编程技巧

织梦下载地址列表页添加面包屑导航的教程

2020-10-30 0:00:00

0 条回复 A文章作者 M管理员

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914
----《》
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索