ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry ’1′ for key ‘PRIMARY’
解决方法:
第1步:将主键字段值为0的那条记录值改为其他大于0且不重复的任意数
第2步:修改主键字段为auto_increment
第3步:把刚才修改过的那条记录的值还原
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30127122/viewspace-2089878/ ,如需转载,请注明出处,否则将追究法律责任。