MyBB Community Forums

Full Version: Deleted users then newly registered have higher uid
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
couldnt fit the description in whole title.

basically:

deleted uid 7-20, create new account and its uid 21. how do i fix
(2019-10-25, 11:40 PM)breadd Wrote: [ -> ]couldnt fit the description in whole title.

basically:

deleted uid 7-20, create new account and its uid 21. how do i fix

It's possible with some work with the database, but it's not necessary to do this.

UID is just an assignment number, nothing important.

The only number that is important is the UID that is put into the config.php for the Super Admin rights.

Aside from that, UID is not that important in terms of seniority or management levels.
That's normal and not something you fix. If you want to reuse those table ids, then you are going to have to make manual SQL commands on the database:

https://www.w3schools.com/sql/
The better way in to re-initialize the ID: alter table mybb_users auto_increment=7
The value of the auto_increment is the next value you want to be set
(2019-10-26, 08:37 AM)Crazycat Wrote: [ -> ]The better way in to re-initialize the ID: alter table mybb_users auto_increment=7
The value of the auto_increment is the next value you want to be set

Yes, you can do that, but if there are any PMs/threads/posts attached to the original UID, then it will be transferred to the next user with the same UID.

For example: If UID #11 is no longer needed, then the username is removed from the table, but all of his/her PMs/messages are still there in the database, so the next user who gets UID #11 will end up with those PMs/messages.

That will violate the EU rules about privacy and erasing the previous user data.

It's best just to leave it alone and move on.
You're right, it depends on why users are deleted.
If it's because they were test before opening the forum, my solution is applicable.
If it's in a working forum, reusing ID is the worst for different reasons, the first one is about everything linked to previous user.
And if the deleted records are not the last in the DB, changing the auto_increment will generate duplicate ID errors when the "hole" will be filled.

An essential rule with DB: don't play with index and unique identifier, unless you know EXACTLY what you're doing.