原来用2.5,执行了用户优化用户表就分成了两个,有什么问题我就不说了,前两天升级了DX3.2顺便把用户表合并清理了,具体步骤如下:
版本:DX3.2
工具:phpmyadmin
说明:我也是按照论坛一位朋友的操作来的,写出来一是给需要做合并的朋友参考,另外也给自己留个记录。。。,数据库操作有风险,自己注意备份,出了问题别来骂我就好,我只是把自己的操作步骤写出来,不证明别人都一定没问题。。。。
-----------------------------------------------------------------------------------------------------
建两个临时表备用,复制主表格式
create table pre_common_member_temp like pre_common_member;
create table pre_common_member_temp2 like pre_common_member;
将主表数据插入临表一
insert into pre_common_member_temp select * from pre_common_member;
备份存档表
create table pre_common_member_archive_bak like pre_common_member_archive;
insert into pre_common_member_archive_bak select * from pre_common_member_archive;
将存档表数据插入临表一
insert into pre_common_member_temp select * from pre_common_member_archive;
将临表一的数据去重复排序插入临表二
insert into pre_common_member_temp2 select * from pre_common_member_temp order by uid;
主表改成bak备份,临表二改成主表名,清空存档表的数据
ALTER TABLE pre_common_member RENAME TO pre_common_member_bak;
ALTER TABLE pre_common_member_temp2 RENAME TO pre_common_member;
TRUNCATE TABLE `pre_common_member_archive`;