Sign in to follow this  
CharlesM

[PROBLEM SOLVED] phpMyAdmin - How to do a mass deletion of users

Recommended Posts

I have a Media Wiki installation, and apparently, it has a LOT of spambot registrations as users. What I want to do is to do a mass deletion of all user accounts for that wiki, with the exception of my own account.

 

I want to do this mass deletion via phpMyAdmin.

 

Can anyone explain to me, step by step, what I need to do, in order to accomplish this?

Share this post


Link to post
Share on other sites

I have a Media Wiki installation, and apparently, it has a LOT of spambot registrations as users. What I want to do is to do a mass deletion of all user accounts for that wiki, with the exception of my own account.

 

I want to do this mass deletion via phpMyAdmin.

 

Can anyone explain to me, step by step, what I need to do, in order to accomplish this?

 

Hi CharlesM,

 

It's generally ill-advised to delete things out of a database directly as sometimes they will have direct relations to other tables. The best way to do it is through the software itself as it will clean up any "loose ends". A quick Google search suggests it may be safe to delete users directly but again I would advise again it.

 

To do something like that you'd go into PHPMyAdmin in your control panel and select the database you installed MediaWiki on. From there you'll get a list of tables - one of them is likely to be named something along the lines of `users` or `user`. Select that and you'll have the option to manipulate the rows - including deleting them. Again I highly advise to not do it via this method.

Share this post


Link to post
Share on other sites

phpMyAdmin is only letting me delete 30 users at a time. I need to delete about twenty thousand, it seems - probably spampbot registrations. I believe that I have it fixed, now, so that no one new can register. I just want to delete all of the spambot accounts that were never approved. I jst don't know how to make phpMyAdmin display more than 30 users at a  time.

Share this post


Link to post
Share on other sites

I managed to figure out how to do what I wanted to do, which was to delete over twenty thousand spambot generated user accounts for my Media Wiki installation via phpMyAdmin.

 

None of these bogus user accounts had any actual postings/edit counts on the wiki.

 

What I did to fix the problem was:

 

1. Pressed SQL button.

 

2. Ran the following SQL Query:

 

DELETE FROM `wiki_user` WHERE `user_editcount` <1

 

It deleted all Media Wiki registered users except for my account, since I had postings/edit counts to my credit.

 

I took a gamble doing this, but it turned out to be what I wanted to do. I didn't want to manually delete all those thousands of registered accounts, thirty at a time. The way that I did it gave me the results that I wanted, and it took only two or three seconds to delete them all.

 

Problem solved!

Share this post


Link to post
Share on other sites

I went back into phpMyAdmin to see just exactly how long that it took to delete all of those bogus registered user accounts.

 

It said: 20668 rows deleted. ( Query took 6.5036 sec )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this