title: ERROR 1062: Duplicate entry '0' for key 'PRIMARY' when adding a primary key
body: <p>I already have a table with some data in it. And now I want to add a new column "id" and make it a primary key. I'm using MySQL Workbench. So, I'm just adding a new key and then setting it as PK and NN. But for some reason, this apparently simple and straightforward operation doesn't work. I get:</p>
  
  <blockquote>
    <p>ERROR 1062: Duplicate entry '0' for key 'PRIMARY' </p>
  </blockquote>
  
  <p>Why is that?</p>