• 返回列表

    [Discuz!] Discuz!遭遇到惡意注冊和灌水后的批量處理方案

    Discuz!站點經常遇到的問題就是惡意注冊和惡意灌水網站在被灌水后整個網站整體體驗就會下降
    注冊量大了之后會造成空間占用龐大、查詢速度下降等問題
    而后臺刪除功能非常消耗系統性能
    并且容易造成誤操作刪除管理員等問題
    因此通過數據庫直接刪除會員以及相關信息會極大的提高刪除效率
    在此提供一些常用的關聯刪除方法方便各位站長使用
    執行sql可以通過phpmyadmin進行
    如果沒有phpmyadmin的站長可以通過修改config_global.php
    1. $_config['admincp']['runquery'] = '0';
    復制代碼
    其中0改成1
    1. $_config['admincp']['runquery'] = '1';
    復制代碼
    這樣就可以通過后臺-站長-數據庫-升級執行sql語句
    1.png

    一般注冊機與灌水機都是批量的注冊賬戶并灌水發帖
    因此注冊的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.登錄后臺-站長-數據庫-優化,對數據庫碎片進行優化,減少占用,提升效率。

    返回列表
    新婚少妇莹莹系列