Deleted users by phpMyAdmin (wrong). Now how to fix?

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
jsundqui
Registered User
Posts: 40
Joined: Thu Apr 29, 2004 2:25 am

Deleted users by phpMyAdmin (wrong). Now how to fix?

Post by jsundqui » Thu Sep 07, 2006 9:07 pm

Back in this thread...
Wo1f wrote: At minimum, even when a user has NOT been activated, there are 3 tables to clean properly. They are the "user_group" and "groups" tables, aside the "users" table.

Even when an activated member has no topics or posts, he might of created "pm" or "topic watch" activites and so on and so forth.

It's been said many times that deleting any users in any state through the "users" table only is just not a good idea, with potential "permissions" problems that may not necessarily manifest themselves now, but may cause headaches down the line.

Hope this is helpful,
Wolf

OK, Roger that. Glad I asked.

So now I got to figure out how to fix it. I am guessing I need to check the list of user_ids in "users" and look for the gaps, some of which are due to my correct deletion, some due to my ham-handed phpMyAdmin deletion. Then I would have to go to the "groups" table, where there are both "group_id" and "user_id" fields. Since the group_id field has bigger numbers, so I am thinking that I would manually delete fields based on the "user-id"s that are present in user_group but not in users.

But I should also make a note of the "group-id"s I am deleting in user_group since the groups table uses the group_id field as the primary key, and the numbers there go up to higher numbers than my "user_id" numbers. So in user_group table I should delete the same "group_id"s that I deleted in the groups table.

Is this correct, or I am I just risking creating a bigger mess? We have about 1000 registered users, and I only deleted about 20 or so through phpMyAdmin, and those were only within the last week.

I am a little concerned because in the user_group table, I have a bunch of "user_id"s that have more than one "group_id"s

User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29253
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

Post by Marshalrusty » Thu Sep 07, 2006 9:33 pm

The easiest way is to grab this script: http://www.phpbbhacks.com/download/4372

It will add an extra module to the administration panel which will allow you to fix inconsistencies within the db.

Because this MOD has not been validated by the phpBB MOD team, you should be extra careful when using it. It has worked flawlessly for me, but I still strongly recommend that you make full backups before running it.
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

Wo1f
Registered User
Posts: 2039
Joined: Fri Jan 28, 2005 3:20 am

Re: Deleted users by phpMyAdmin (wrong). Now how to fix?

Post by Wo1f » Thu Sep 07, 2006 9:56 pm

jsundqui wrote: I am a little concerned because in the user_group table, I have a bunch of "user_id"s that have more than one "group_id"s


Nothing to worry about, as this simply indicates that "the users" belong to more than 1 group.

Let us know how you managed the "clean-up" after using Marshalrusty's recommendation.

Regards,
Wolf

jsundqui
Registered User
Posts: 40
Joined: Thu Apr 29, 2004 2:25 am

Post by jsundqui » Fri Sep 08, 2006 2:00 am

Thanks for the tips. I always try stuff like this on my (not up to date) mirror of my site on my home linux box first. It will take a while to back up, and transfer the database over, etc. etc.

I've got a day job, so I will get to this Saturday instead and let you know how it goes.

Meanwhile, it looks like this mod may make it easy to do one-click (or so) deletes of spammers:

http://www.phpbbhacks.com/download/6208

jsundqui
Registered User
Posts: 40
Joined: Thu Apr 29, 2004 2:25 am

Post by jsundqui » Fri Sep 15, 2006 2:06 am

I did the DB maintenance MOD which worked well. Deleted a number of empty groups that were about the number of records I think I deleted ham handedly with phpmyadmin from users.

Then I ended up putting in this MOD:

http://www.phpbb.com/phpBB/viewtopic.php?t=404113

Which makes it much easier to delete spammers.

Now I need to find some time to try some of the tricks to keep them from signing up in the first place!

Locked

Return to “2.0.x Support Forum”