Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By gnosis.kv on
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
You need to change the value
You need to change the value in the sequences table, in the row for nids, to 9999.
thanks cog.rusty.after
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.
Re: how to make nid starts from 10000
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.
No
Do NOT do that. Drupal does not use auto_increment. You need to look at the sequences table.
and how to make uid start
and how to make uid start from 10.000 ?
In Drupal 5, go to the
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.
thanks man! It works
thanks man!
It works
In drupal 6
In drupal 6 if you do not have phpmyadmin run the following sql
ALTER TABLE `users` AUTO_INCREMENT =10000;
E Ismail
This solution worked for me
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