帝国cms7.2+utf 昨天晚上还是正常的,今天上午编辑电话说,不能发文章了,技术心理一阵难过,这周日过的。
出现这错误:

还有一个表现就是,修改任何一篇文章,都显示链接不存在,但是可以刷新文章。
后台查看,ecms_news_index的记录数字,只有7个,远远小于ecms_news的记录数,正常情况下,二者应该是一样的。只是不知为何这表丢数据了。
查看字段后,发现除了checked字段外,其余字段可以从主表ecms_news中导出。所以...
===重新生成新闻数据索引表=====
CREATE TABLE [!db.pre!]ecms_newstemp AS(SELECT id,classid,newstime,truetime,lastdotime,havehtml FROM [!db.pre!]ecms_news);
ALTER TABLE `[!db.pre!]ecms_newstemp` ADD COLUMN `checked` tinyint(1) not null DEFAULT 0 AFTER `classid`;
ALTER TABLE `[!db.pre!]ecms_newstemp` add primary key (id);
alter table [!db.pre!]ecms_news_index rename to [!db.pre!]ecms_news_indexbak;
alter table [!db.pre!]ecms_newstemp rename to [!db.pre!]ecms_news_index;
ALTER TABLE `[!db.pre!]ecms_news_index` CHANGE `id` `id` INT(10) NOT NULL AUTO_INCREMENT;
alter table [!db.pre!]ecms_news_index add index(classid);
alter table [!db.pre!]ecms_news_index add index(checked);
alter table [!db.pre!]ecms_news_index add index(newstime);
alter table [!db.pre!]ecms_news_index add index(truetime);
update [!db.pre!]ecms_news_index set checked=1;
====建议分条执行,一是避免超时,二是能发现错误====
终于搞定,赶紧备份了一下。
[此帖子已被 海蓝港湾 在 2015-3-20 23:10:41 编辑过]
[此帖子已被 海蓝港湾 在 2015-3-20 23:18:06 编辑过]
[此帖子已被 海蓝港湾 在 2015-3-21 8:05:15 编辑过]