Discuz教程网

Discuz!遭遇到恶意注册和灌水后的批量处理方案

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

其中0改成1
  1. $_config['admincp']['runquery'] = '1';
复制代码

这样就可以通过后台-站长-数据库-升级执行sql语句
forum.php?mod=attachment&aid=MTIwNnxkMGZkMjlhY3wxNDMyNjMwMzc0fDE4M3wxNDYw&noupdate=yes&.jpg

一般注册机与灌水机都是批量的注册账户并灌水发帖
因此注册的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.登录后台-站长-数据库-优化,对数据库碎片进行优化,减少占用,提升效率。



上一篇:Dx3.2上传mp3不能播放,不显示播放器的解决方法
下一篇:如何修改应用中心的安全密码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 08:59

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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