Is it possible to fix/repair all Index, Primary Key, Unique (and all other) structure of a WordPress MS Database

Yes the issue is due to the auto increment setting.

All WordPress DB specifics can be found here, which includes details on which ones use auto increment: https://codex.wordpress.org/Database_Description

This isn’t going to be an easy task, but here’s some sites to help you:
https://www.photographerstechsupport.com/tutorials/fixing-wordpress-indexes-foreign-keys-and-auto_increment-fields/

This one is specific to wp_options:
https://guides.wp-bullet.com/fixing-wp_options-table-missing-unique-column-primary-key/

Specifically the auto increment:
https://stackoverflow.com/questions/8923114/how-to-reset-auto-increment-in-mysql

You need to make sure that whatever you set the auto increment to, that you take the largest number in the ID column, +1 and use that.

Basically that tells the DB next time a new row is inserted, what ID to use when doing the auto incrementation.

SO related post: WordPress Database lost auto increment

Leave a Comment