Hi,

for some reason i want the nid starts from 10000 instead of 1, how to do it?

I tried to set "ALTER TABLE `drupal`.`node` AUTO_INCREMENT = 10000;" to my db, but it does not work.

thanks in advance.

Comments

cog.rusty’s picture

You need to change the value in the sequences table, in the row for nids, to 9999.

gnosis.kv’s picture

thanks cog.rusty.

after update the sequences table, it works.

to make vid also start form 10000, just update "node_revisions_vid" in sequence table to 9999.

drupalnesia’s picture

Use phpMyadmin, open the first node, change nid to 10000 and let AUTO_INCREMENT=1.
The AUTO_INCREMENT parameter used for increase the nid, i.e: if your current nid=5 and AUTO_INCREMENT=20 then the next nid will be 25, 45, 65 and so on.

mlhess’s picture

Do NOT do that. Drupal does not use auto_increment. You need to look at the sequences table.

Alan Oliveira’s picture

and how to make uid start from 10.000 ?

cog.rusty’s picture

In Drupal 5, go to the "sequences" table with phpmyadmin, browse it, find the "users_uid" row and change its value to 10000.

In Drupal 6, go to the "users" table, select the "Operations" tab at the top, and change "auto_increment" to 10000.

You must have already created the special "user 1" account before doing that.

Alan Oliveira’s picture

thanks man!
It works

rocket777’s picture

In drupal 6 if you do not have phpmyadmin run the following sql

ALTER TABLE `users` AUTO_INCREMENT =10000;

E Ismail

Anil Kumar Vallur’s picture

Hi cog, your comment helped me to get the solution

Here is what I did

Step 1: go to phpmyadmin of your site
Step 2: Select the database that you are using for your Drupal site
Step 3: Select node table
Step 4: Go to Operations tab, click on it
Step 5: You'll see auto increment in the table options
Step 6: Set it to the value what you thought of. I have set it to 2015310001 using the following query
ALTER TABLE `node` AUTO_INCREMENT =2015310001