ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '1' for key 'PRIMARY'

2

I'm trying to put id as the primary key but it gives this error:

  

ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '1' for key 'PRIMARY'

    
asked by anonymous 17.07.2014 / 03:10

1 answer

4

Is there a line with a value of 0 or NULL in this field? If so, you'll need to update them earlier for some value greater than zero. You can go back to 0 later if you want.

    
17.07.2014 / 03:14