If you want to remove the auto-increment and the primary key from the ID column in a single SQL statement, this should do. ALTER TABLE wp_posts CHANGE ID ID int(11) UNSIGNED NOT NULL; -- Removes auto-inrement from ID DROP INDEX `PRIMARY` ON wp_posts; -- Removes index PRIMARY from provided table ALTER TABLE wp_posts ADD primary key (ID); -- Add index again ALTER TABLE wp_posts DROP PRIMARY KEY, CHANGE ID ID int(11) UNSIGNED NOT NULL; ALTER TABLE wp_posts ADD primary key (ID);
Engineering
How to reindex tables with MySQL
[code lang=”sql”] ALTER TABLE wp_posts CHANGE ID ID int(11) UNSIGNED NOT NULL; — Removes auto-inrement from ID DROP INDEX `PRIMARY` ON wp_pos
· 5 min read
Related posts
Engineering
My 3 days trip to Swat, Malam Jabba and Kalam (20th Mar to 23rd Mar)
Pakistan is a land of natural beauty and has been blessed with the abundance of awe-inspiring outdoor areas. From the unspoiled golden beaches,across the desola
Engineering
Lamudi.pk is The Fastest growing real estate startup in Pakistan
There are several online real estate portals running in Pakistan, a couple of them have captured the market and leading the industry. In such a scenario it’s ha
Engineering
Trigger Google conversion on some event
Normally Google conversion code is added in header or footer of the “Thank you for your purchase” pages. A conversion is logged when someone lands o