User ID = 999999999?
I have recently integrated a bbpress install with an existing wordpress blog/site. The WP blog had three users prior to the integration, and all three made it over to the bbpress install with no problems. However, today a new user registered on the WP side and her ID defaulted to 999999999.
I proceeded to register a “dummy” user, just to see what happened. The next registration ticked up to user ID #1000000000. While I doubt that this will lead to any serious problems, it seems silly to me to have user IDs starting around ONE BILLION, when even 1,000 would be plenty high enough for my lil’ ol’ site. Having McDonald’s-esque “XX billions served” sized numbers seems to fly in the face of the “Code is poetry” mantra.
Any ideas as to what’s going on here?
When you are integrated with bbPress, it uses the wp_user table for users. It shouldn’t have done anything to your WP install just integrating with bbPress. That is strange. I don’t think I have ever seen this one. Even with both integration plugins, registering in either program I can’t replicate this. Anyone else seeing this as well?
If you have access to phpMyAdmin, you can reset the auto_increment field to start over at 6 or wherever you are right now. I’ve never seen this one either, but somehow the auto_increment appears to have gotten messed up.
OK… so I do have access to phpMyAdmin, which may not be such a good thing.
Somehow I got some things crossed up so I am now getting these messages from within the wp_users table:
!!! PRIMARY and INDEX keys should not both be set for column
!!!More than one INDEX key was created for column
!!!UNIQUE and INDEX keys should not both be set for column
Here is the raw text of the indexes from that page:
Keyname Type Cardinality Action Field
PRIMARY PRIMARY 5 Edit Drop ID
user_login UNIQUE 5 Edit Drop user_login
user_login_key INDEX None Edit Drop user_login
ID_2 INDEX None Edit Drop ID
ID_3 INDEX None Edit Drop ID
ID_4 INDEX None Edit Drop ID
This is a longshot, but can you tell what I messed up, and how I should fix it? Sorry. I really appreciate the help.
While I wait for a response I will be banging my head against my desk for not backing up the DB before I started messing around with it.
I wish I could help you on that one…..you don’t remember what you changed? Do you have a backup?
I looked at the tables in another WP install and fixed this one so that it matched. We’ll see if I run into any trouble…
this has happened to me as well. Two new users have registered and have IDs 99999999 and 1000000000. They appear to be spam though so I was very worried that they’d somehow managed to hack their user id from the front end??? Highly unlikely though.
I am wondering if the conversion from phpBB to bbpress has anything to do with it? ( https://bbpress.org/forums/topic/47?replies=12 )
Did you use this wittmania? I did, and these are the first users to register since the migration. I will investigate a bit further over the next few days when i get the chance….
I did run the conversion, but it didn’t work very well because I ended up with duplicate IDs, and therefore posts from phpbb were attributed to the wrong authors in cases where their IDs conflicted.
Now that you mention it, I wonder if the phpbb importer makes a change so that all new registrations would start at 999999999 just so there couldn’t possibly be any conflicts. I don’t know enough about mysql to know if that’s the case (or if it is, how to “fix” it), but if I were the one building the importer, I would probably add a feature like that, though I think a number around one billion might be a bit of overkill!
I have exactly the same “problem”. It all started after converting my phpBB to bbPress so I think thats the problem.
Can anyone enlighten me/us as to how to reset that auto increment using phpmyadmin or something similar? I doubt it is causing any real problems, but it still is kind of ugly.
So, it sounds like this is related to the conversion from phpBB. At least that narrows it down.
In phpMyAdmin, select the table (be that bb_users or wp_users) and then select the “operations” tab up top. On that page, near the bottom are “Table options:” and in there is a field that says [ xxx ] auto_increment where the xxx is the next auto_increment value that will be used. That’s where you would change it.
You should first figure out what that value should be, and you should also fix the other high numbered users. But that’s where you reset it with phpMyAdmin. *** Perform at your own risk. ***
You can also just do it with SQL:
ALTER TABLE 'wp_users' AUTO_INCREMENT =whatever-number
The wp_users tablename might be bb_users or something else in your install. Also, the table name should be backticked, but you can’t do that in a block of code that’s already backticked here
I’ll confirm that I have this problem as well, from a phpbb to bbpress conversion. I actually tried to reset the auto_increment like chrishajer said:
ALTER TABLE bb_users AUTO_INCREMENT = 400
Since my original ID’s stopped at around 350.
It didn’t work though, still incrementing in the billions. MySQL documentation says:
“You cannot reset the counter to a value less than or equal to any that have already been used.”
So to me that reads I need to delete the admin user 999999999 first, am I correct?
Ok this worked for me, here’s how I actually reset the auto_increment counter.
NOTE: If you’ve already integrated WP and bbpress and/or if you’ve already had a bunch of new users register, this wont be so easy for you. If however, you’ve performed a fresh installation and conversion then this will be simple.
1. make sure one of my existing users in the normal ID range is a Key_Master (this is very important). For me, I made one of my users with ID =5 the Key Master.
2. login with the new Key Master, and delete all the users who are registered with a number => 999999999. For me this wasn’t a problem because “admin” was the only user, I haven’t had any new user registrations. If you do have new users in the 1000000000 range you’ll need to reset their ID’s (I’m not a MySQL guy so I dunno how)
3. Once all users in the ugly high number range are deleted, you can run the command to reset the counter on your *_users table, for me it was:
ALTER TABLE bb_users AUTO_INCREMENT = 400
I just added a few new users and they indeed started at ID 400.
BTW, here’s the code in the phpbbtobbpress.php converter that sets this very high ID:
//Let's clean up the trash.
//Your admin user will be given the biggest possible ID (I tried the biggest BIGINT but it didn't work inside bbPress)
//If you have more than 999999999 users on your forum, you may have problems...
@mysql_query ("UPDATE " . $bbpress_tables['users'] . " SET ID=999999999 WHERE ID=1");
@mysql_query ("UPDATE " . $bbpress_tables['usermeta'] . " SET user_id=999999999 WHERE user_id=1");
@mysql_query("TRUNCATE TABLE " . $bbpress_tables['forums']);
- You must be logged in to reply to this topic.