0

I've deleted a bunch of members (on purpose), so that I only have member_id '1' left. Now if I create a new member... The newest member_id is '176' and then increments as I add more… If the members have been deleted where did expression engine get that number from? The last member_id created must be stored somewhere in order for EE to reference it? I can’t find it for the life of me.

1 Answer 1

0

This has nothing to do with ExpressionEngine. This is a counter that exists in MySQL when a column is set to AUTO_INCREMENT and is the primary key.

You can reset the column in this table if you'd like.

TAKE A BACKUP OF YOUR exp_members TABLE BEFORE PROCEEDING

This warning is just in case you fall down the rabbit hole of miss-typed syntax.

Run this MySQL query (provided your table prefix is the standard exp) to reset your counter to whatever you'd like:

USE `my_database_name`;
ALTER TABLE `exp_members` AUTO_INCREMENT = 1;

Set 1 to whatever you want the counter to start with (it will default to highest current index plus one if you have a row with 1 for the primary key). Remember, messing with your production database requires serious caution.

2
  • Thank you @jrohafer, how is the auto_increment number remembered? Is it just in memory? Also, how can I contact you for a project? Dec 8, 2016 at 8:44
  • It just lives as meta-data in your MySQL information schema, I believe. Either way, it's an implementation of a counter in standard table engines like MyISAM and InnoDB. Unfortunately, I couldn't be more loaded with work right now, so I'm not available to take on any contracts/jobs, Sorry!
    – jrothafer
    Dec 8, 2016 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.