帝国cms数据索引表重建,应用于ecms_news_index表损坏丢失或者错误时!
帝国cms数据索引表重建,应用于ecms_news_index表损坏丢失或者错误时!
帝国cms怎么重建数据索引表?下面帝国CMS模板网就来为大家分享:
出现这错误:
还有一个表现就是,修改任何一篇文章,都显示链接不存在,但是可以刷新文章。
后台查看,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;
PS:建议分条执行,一是避免超时,二是能发现错误
相关文章
- 无相关信息
热门排行
-
帝国cms网站地图sitemap.xml的制作方法2022年03月07日88
-
帝国CMS信息提示页美化模板(分享一个帝2022年03月09日55
-
帝国CMS怎么提高网页打开速度?(帝国CMS提2022年04月06日54
-
帝国CMS内容模板获取所有分页数和当前2022年04月05日49
-
帝国cms列表页调用文章关键词与tag的方2022年03月07日46
-
帝国CMS列表页文章怎么升序降序排列文2022年03月11日46