• 微信
您当前的位置:首页  > 文章 >  重建帝国cms数据索引表,用于ecms_news_index表损坏丢失或者错误

重建帝国cms数据索引表,用于ecms_news_index表损坏丢失或者错误

作者:admin 时间:2019-10-19 阅读数:人

出现这错误:

重建帝国cms数据索引表,用于ecms_news_index表损坏丢失或者错误

还有一个表现就是,修改任何一篇文章,都显示链接不存在,但是可以刷新文章。

后台查看,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;

====建议分条执行,一是避免超时,二是能发现错误====

声明

源码下载不顺利,比如源码在百度网盘的有时会被无故取消等,请联系QQ:46667551
本站大部分下载资源收集于网络,但除特别说明之外,基本全部亲自测试可用!
但由于某些源码的更新迭代,比如微信小程序官方接口的变动等原因,
如时间过长,可能会造成本可以使用的代码出现问题,下载前请斟酌!
本站资源仅供学习和交流使用,版权归原作者所有,请在下载后24小时之内自觉删除。
若作商业用途,请购买正版,由于未及时购买和付费发生的侵权行为,使用者自行承担,概与本站无关。

原文链接:https://www.dnwfb.com//102.html,转载请注明出处