title: How to Auto Increment the Primary Key of wp-posts in Wordpress?
body: <p>I have migrated my WordPress website to another hosting server, and now I cannot create new posts. I have tried these methods to fix it but couldn't get success:</p>
  <ol>
  <li>enable/disable plugins</li>
  <li>change the theme</li>
  <li>check the syntax of wp-config</li>
  <li>database repair</li>
  <li>contact hosting</li>
  </ol>
  <p>I came to know that after importing the WordPress database to the new hosting server, some of my primary keys got disturbed. Now, I want to edit the table &quot;wp_posts&quot; and make its primary key (which is &quot;id&quot;) to auto increment. Following is the SQL query but it's not working:</p>
  <pre><code>ALTER TABLE wp_posts AUTO_INCREMENT id = 1;
  </code></pre>
  <p>Following is the screenshot of the existing wp-posts table:
  <a href="https://i.stack.imgur.com/UvBHF.png" rel="nofollow noreferrer">enter image description here</a></p>