discuz x 3.4 用户表 主表 存档表 数据合并教程!

[复制链接]
77 |9
发表于 7 小时前 | 显示全部楼层 |阅读模式
1,登录后台,工具,计划任务,取消勾选 每日用户表优化

2,关闭站点,备份数据库,如果可以,全站备份更好

3,不要手贱去点 后台,站长,用户表优化

4,打开你的MYSQL管理工具,比如 phpMyAdmin

几个受影响需要更改的表
  1. pre_common_memberpre_common_member_archivepre_common_member_countpre_common_member_count_archivepre_common_member_field_forumpre_common_member_field_forum_archivepre_common_member_field_homepre_common_member_field_home_archivepre_common_member_profilepre_common_member_profile_archivepre_common_member_statuspre_common_member_status_archive
复制代码

5,看一下上面数据库中的几个表,受影响了几个,受影响的都要修改


打开  pre_common_member_archive

删除重复内容
  1. ALTER IGNORE TABLE pre_common_member_archive ADD UNIQUE INDEX(`uid`)
复制代码

把 pre_common_member_archive 内容复制到 pre_common_member
  1. insert into pre_common_member select * from pre_common_member_archive
复制代码

再删除主表重复内容,清空存档表内容


上面做完基本就没事了,有强迫症的可以删除带有Archive的空表,备份的bak表都可以删除

删除带有Archive的空表,更新缓存的时候出现这个错误,而且注册不了(在注册的最后一步会出现不跳转的情况)
  1. (1146) Table 'db_web411070.common_member_archive' doesn't existSELECT COUNT(*) FROM common_member_archive
复制代码

在站长—数据库—升级(Discuz! 数据库升级 - 请将数据库升级语句粘贴在下面:)中执行语句

为了数据安全执行该语句前建议备份数据


  1. DELETE FROM `pre_common_setting` WHERE `skey` = 'membersplit';
复制代码

后台,站长,数据库,升级
  1. insert into pre_common_member select * from pre_common_member_archive;insert into pre_common_member_count select * from pre_common_member_count_archive;insert into pre_common_member_field_forum select * from pre_common_member_field_forum_archive;insert into pre_common_member_field_home select * from pre_common_member_field_home_archive;insert into pre_common_member_profile select * from pre_common_member_profile_archive;insert into pre_common_member_status select * from pre_common_member_status_archive;
复制代码


以上六条的意思就是把六个存档表中的东西合并到主表中。

然后再使用如下升级数据库:
  1. TRUNCATE TABLE  `pre_common_member_archive`;TRUNCATE TABLE  `pre_common_member_count_archive`;TRUNCATE TABLE  `pre_common_member_field_forum_archive`;TRUNCATE TABLE  `pre_common_member_field_home_archive`;TRUNCATE TABLE  `pre_common_member_profile_archive`;TRUNCATE TABLE  `pre_common_member_status_archive`;
复制代码


以上六条的意思就是把六个存档表数据全部清空。
回复

使用道具 举报

发表于 7 小时前 | 显示全部楼层
如果有文件执行就好了,改数据库不太懂

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

发表于 7 小时前 | 显示全部楼层
果断MARK,前十有我必火!
回复

使用道具 举报

发表于 7 小时前 | 显示全部楼层
可以跟旧论坛的表合并吗
回复

使用道具 举报

发表于 7 小时前 | 显示全部楼层
同一discuz x 3.4程序版本才可合并
回复

使用道具 举报

发表于 7 小时前 | 显示全部楼层
都是3.4版本的
回复

使用道具 举报

发表于 7 小时前 | 显示全部楼层
这方法只适用于一个discuz x 3.4 用户表 主表 存档表 数据合并,不支持两个discuz x 3.4论坛用户表 主表 存档表合并。
回复

使用道具 举报

发表于 7 小时前 | 显示全部楼层
楼主你好,我的情况就是你说的 手贱 点了后台的站长  用户数据表优化,可否有偿帮忙解决一下,我的VX:jingjianchun  加我一下
回复

使用道具 举报

发表于 7 小时前 | 显示全部楼层
关闭用户数据表优化,更新缓存,即可。
回复

使用道具 举报

发表于 7 小时前 | 显示全部楼层
X3.5一样吗?能出个3.5的教程吗?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表