Board logo

标题: [Discuz!] Discuz!遭遇到恶意注册和灌水后的批量处理方案 [打印本页]

作者: 冷如冰    时间: 2015-2-2 11:49     标题: Discuz!遭遇到恶意注册和灌水后的批量处理方案

Discuz!站点经常遇到的问题就是恶意注册和恶意灌水网站在被灌水后整个网站整体体验就会下降
注册量大了之后会造成空间占用庞大、查询速度下降等问题
而后台删除功能非常消耗系统性能
并且容易造成误操作删除管理员等问题
因此通过数据库直接删除会员以及相关信息会极大的提高删除效率
在此提供一些常用的关联删除方法方便各位站长使用
执行sql可以通过phpmyadmin进行
如果没有phpmyadmin的站长可以通过修改config_global.php
  1. $_config['admincp']['runquery'] = '0';
复制代码
其中0改成1
  1. $_config['admincp']['runquery'] = '1';
复制代码
这样就可以通过后台-站长-数据库-升级执行sql语句
1.png
2015-2-2 11:47


一般注册机与灌水机都是批量的注册账户并灌水发帖
因此注册的uid一般是连续的
可以通过uid来批量删除用户及相关数据
比如大于某uid的批量删除的sql
  1. set @delid = 1000000;
  2. delete from pre_home_feed where uid > @delid;
  3. delete from pre_home_share where uid > @delid;
  4. delete from pre_home_comment where uid > @delid;
  5. delete from pre_home_blogfield where uid > @delid;
  6. delete from pre_home_blog where uid > @delid;
  7. delete from pre_home_class where uid > @delid;
  8. delete from pre_home_pic where uid > @delid;
  9. delete from pre_common_member where uid > @delid;
  10. delete from pre_common_member_count where uid > @delid;
  11. delete from pre_common_member_field_forum where uid > @delid;
  12. delete from pre_common_member_field_home where uid > @delid;
  13. delete from pre_home_album where uid > @delid;
  14. delete from pre_home_docomment where uid > @delid;
  15. delete from pre_home_doing where uid > @delid;
  16. delete from pre_home_notification where authorid > @delid;
  17. delete from pre_forum_post where authorid > @delid;
  18. delete from pre_forum_thread where authorid > @delid;
  19. delete from pre_portal_comment where uid > @delid;
  20. delete from pre_common_member_profile where uid > @delid;
  21. delete from pre_common_member_status where uid > @delid;
  22. delete from pre_ucenter_members where uid > @delid;
复制代码
其中
  1. set @delid = 1000000;
复制代码
是定义uid=1000000
大于该uid的用户和关联数据全部删除
可以根据自己站点实际情况定义该值
其中的语句可以单独拆分进行处理

删除数据后还要对网站进行一下扫尾工作
1.登录后台-工具-更新缓存,避免前台数据与实际数据不吻合。
2.登录后台-站长-数据库-优化,对数据库碎片进行优化,减少占用,提升效率。

图片附件: 1.png (2015-2-2 11:47, 28.97 KB) / 下载次数 2860
http://www.verydz.com/help/attachment.php?aid=1206&k=7b9363b3468f772e465ff05c293b7be0&t=1711694708&sid=Cz3l2P






欢迎光临 帮助中心_DZ动力 (http://www.verydz.com/help/) Powered by Discuz! 7.2