Hello

I have 2 nodes numbered 6 and 7. Due to much testing of import / export, the next node starts at 380. I would like to reset this to 8 for my next node. There is an article explaining how to update the sequences table but this does not exist in my MYSQL DB and I think it is therefore referring to an older version of drupal.

If possible can you post the MYSQL Syntax so I can log into my DB and execute it direct.

Thanks
naRen

Comments

arhak’s picture

ALTER TABLE `node` AUTO_INCREMENT=8

arhak’s picture

also you can use phpMyAdmin

- go to table node
- go to tab Operations
- look into the group Table options there is a textfield AUTO_INCREMENT with your current auto increment value
- change it to what ever you want (ensuring it is a valid available id)
- submit with its Go button

rengomez’s picture

THAT worked perfectly, thanks. Note that you cannot set the value to less that the latest value that's in there. So although I do not have a /node/1, I can only reset to a minimum of 8 as my last node is /node/7

Thanks again!
naRen

didaka’s picture

Thanks arhak,
This works, perfect.
Regards,
Daniel

rikimaru0007’s picture

I have node ID 7 and 9,
and then I set my auto increment to 8, will this operation bypass node ID 9 and then automatically name my node to 10?

arhak’s picture

AFAIK if the table has an ID 9, then the minimum for the auto increment will be 10,
if you try to set it lower it makes it 10 anyway, so nothing brakes (and 8 won't be used)

amocsy’s picture

Doesn't that means that the easyest way would be to allwas set increment to 0?
like:
ALTER TABLE `node` AUTO_INCREMENT=0

arhak’s picture

do you mean to ensure the lowest value will be given?
I guess it will do

Cablestein’s picture

arhak's tip also works great for me.

I reset from 308 to 1.

If you try 0, it refreshes and nothing happens. It gives no error and your number remains the same.

MySQL 5.1.47