百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>Discuz教程> Discuz! X3.2遭遇到恶意注册和灌水后的批量处理方案
分享本文到:

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

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

一般注册机与灌水机都是批量的注册论坛模板账户并灌水发帖
因此注册的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~10元,土豪随意,感谢您的阅读!

相关文章

共有11人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

订阅获得更多模板