Resetting the primary key to 1 after deleting all the data
The code below is best if you have some data in the database already but want to reset the user_id to 1 without deleting the data. Copy and run in SQL command
ALTER TABLE members DROP user_id;
ALTER TABLE members AUTO_INCREMENT = 1;
ALTER TABLE members ADD user_id int UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE some_table AUTO_INCREMENT=1
So some_table
would be the table you want to alter.
You could also use:
TRUNCATE TABLE some_table
This will reset the Auto Increment on the table as well as deleting all records from that table.