1,登录后台,工具,计划任务,取消勾选 每日用户表优化

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

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

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

 

几个受影响需要更改的表

pre_common_member
pre_common_member_archive

pre_common_member_count
pre_common_member_count_archive

pre_common_member_field_forum
pre_common_member_field_forum_archive

pre_common_member_field_home
pre_common_member_field_home_archive

pre_common_member_profile
pre_common_member_profile_archive

pre_common_member_status
pre_common_member_status_archive

 

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

打开 pre_common_member_archive

删除重复内容

ALTER IGNORE TABLE pre_common_member_archive ADD UNIQUE INDEX(`uid`)

把 pre_common_member_archive 内容复制到 pre_common_member

insert into pre_common_member select * from pre_common_member_archive 

 

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

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

删除带有Archive的空表,更新缓存的时候出现这个错误,而且注册不了(在注册的最后一步会出现不跳转的情况)

(1146) Table 'db_web411070.common_member_archive' doesn't existSELECT COUNT(*) FROM common_member_archive

 

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

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

DELETE FROM `pre_common_setting` WHERE `skey` = 'membersplit';

 

若没有找到执行语句的输入窗口 则修改

config/config_global.php

当中的

$_config[admincp][runquery] 设置修改为 1

(为了安全执行完该语句后 确认解决了1146错误后 再将配置该回来 ) 刷新后再输入执行。

 

后台,站长,数据库,升级

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;

 

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

然后再使用如下升级数据库:

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`;

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