MyBB Community Forums

Full Version: Reset UID Numbers Count
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can anyone tell me how to reset Uid count?


Like I have 500 users and due to some reasons i deleted 400 and now due to auto increment function when new user register its count start from 500 onwards.

I want to start count from 100 upward and reset the existing users in serial order ?

Is it possible ? if yes how ??
If the users accounts you deleted didn't made any posts it's simple to do that but if they did and they still exist these posts will be assigned to the new users. So you need to make sure that there isn't any reference to the UIDs you deleted.

If everything checks out, run this code in phpMyAdmin:
ALTER TABLE mybb_users AUTO_INCREMENT = 100;

You may need to change the prefix if you use anything else than "mybb_".
Go to: ACP > Tools and Maintenance > Recount and Rebuild > and run the following two options;
Recount Statistics
Rebuild Forum Counters
(2011-01-19, 08:41 AM)Yaldaram Wrote: [ -> ]Go to: ACP > Tools and Maintenance > Recount and Rebuild > and run the following two options;
Recount Statistics
Rebuild Forum Counters

That doesn't reset the auto increment value of MySQL. It simply rebuilds the stats and counters for MyBB.
yes aries u r right Smile


thanks a lot i just edit the value in operations in phpmyadmin.

and if we change manually uid of some person like 15 to 10 i dont think there is any effect of login etc ?

condition: there is no post of person whose uid is 15. and there is user with uid 10 exist.
(2011-01-19, 08:43 PM)manan Wrote: [ -> ]and if we change manually uid of some person like 15 to 10 i dont think there is any effect of login etc ?

condition: there is no post of person whose uid is 15. and there is user with uid 10 exist.

Hmm, this would mean that also the posts of uid 10 will be lost. A better solution is to merge two users. AdminCP > Users & Groups > Users > Merge Users (tab) ... Then enter the username of the source and the destination account. The "Source Account" will be removed.
aries

sorry my mistake i mean uid no. 10 does not exist Toungue

btw thanks for info.