MyBB Community Forums

Full Version: Fix UIDs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When my forum was first launched, many spam bots registered and i was forced to delete their accounts as there were around 120 members and 100 of them were spam bots. So i deleted them.

Now, i want to fix my uids. Members who register now, continue with 121 and onwards. Can i fix this?

Any MySQL query or something? I really need to fix this.
You would need to update the auto-increment setting for the table, but I don't use phpMyAdmin for it and don't know if there is a query you could actually run that would be more efficient.

Using a program like Navicat for MySQL, you could set the default to the next number. If you have 20 members, the last used would be 20, so you would use 21. (Make sure you update all the UIDs for _users and _posts among other tables that reference a UID to the correct number if you decide to reset the auto-increment count)
[Image: NavicatDesignTable.png]
Under the "Options" tab, there is a field called "Auto Increment" with a number in it. Change it to 21.
Click save when finished.

When using Navicat, you must have remote MySQL access and (preferably) only allow your current public IP address if you are not hosting the database locally (localhost) on your computer.
I'm using phpmyadmin and i can't edit the tables of mybb_users. I actually don't know how to.

I know what to do now,
-Edit all uids of existing users from 1 to 42. (I have 42 members at the moment)
-Change the default number to 43.

I can't find the way to edit the uids of existing users in mybb_users. This is the only problem.
Changing the uid of existing users is a bad idea as they are in several tables and there are chances you can miss some.
If you have pruned the users (removed all the traces alongwith user deletion) you can make a modification to registration process to trace the available uid and allot to the next registration, but again, its risky too, if any of the post assigned to some uid (forget about the logs and other entries), user of which doesn't exist - the post will show up under new user's name.

So, its better not to worry about maintaining the serial ...
I'm checking every table and I've found the way to edit them too. Thanks guys.

EDIT: The default is not working. In the mybb_users, when i add the number : 47 in the default box (i have 46 members now) it still starts with 126. How can i fix this?

Any help? Really need it.
Run this query:
ALTER TABLE mybb_users AUTO_INCREMENT = 47;
I also suggest avoiding doing this because of how many tables there are that rely on userids.