Change the auto-increment field to one previous

One fine day, Wordpress unexpectedly jumped from mailbox number 9110 to post 890000000. In a few days I would like to return to new messages to continue with id 9111. I'm sure id will never reach id 890000000, there is no problem, but id is an auto-increment field and ALTER TABLE wp8_posts AUTO_INCREMENT = 9111does not work.

Can I get id to continue working with 9111?

+3
source share
1 answer

You probably need to renumber an existing post so that it has the identifier 9111, and then issue the alter table command. You will have to change the ID in all other tables that point to this identifier. If you then run the alter table command, it should work. If this still does not work, you can rename the table, for example, to wp8_posts_backup, with

RENAME TABLE wp8_posts TO wp8_posts_backup

Then create another table with the same schema:

Create Table wp8_posts LIKE wp8_posts_backup;

. - , , , 890000000 . , , , , . .

+2

Source: https://habr.com/ru/post/1736877/


All Articles