很多网站出现过由于计划任务的每日用户表优化自动执行遇到以下报错:Column count doesn't match value count
at
row,将提示信息的 pre_common_member 、 pre_common_member_status 这两个表的归档表删除,并以主表为基准手工
新建了两个和主表数据一致的归档表,然后自动执行计划任务的每日用户表优化就正常了,但是如此操作之后会造成 UC 中心的用户总数与论坛显示的会员总数不一
致的情况,这个时候可以尝试将存档表合并到主表中,需要执行的 sql 语句如下:

  1. insert into pre_common_member select * from pre_common_member_archive;
  2. insert into pre_common_member_count select * from pre_common_member_count_archive;
  3. insert into pre_common_member_field_forum select * from pre_common_member_field_forum_archive;
  4. insert into pre_common_member_field_home select * from pre_common_member_field_home_archive;
  5. insert into pre_common_member_profile select * from pre_common_member_profile_archive;
  6. insert into pre_common_member_status select * from pre_common_member_status_archive;

再执行:

  1. TRUNCATE TABLE  `pre_common_member_archive`;
  2. TRUNCATE TABLE  `pre_common_member_count_archive`;
  3. TRUNCATE TABLE  `pre_common_member_field_forum_archive`;
  4. TRUNCATE TABLE  `pre_common_member_field_home_archive`;
  5. TRUNCATE TABLE  `pre_common_member_profile_archive`;
  6. TRUNCATE TABLE  `pre_common_member_status_archive`;

这样就可以了。