Error Code: 1062. Duplicate entry '1' for key 'PRIMARY'

后端 未结 8 2149
既然无缘
既然无缘 2020-12-01 03:55

I have a problem on this error message, when i try this:

INSERT INTO `PROGETTO`.`UFFICIO-INFORMAZIONI` (`ID`, `viale`, `num_civico`,  
`data_apertura`, `data         


        
8条回答
  •  不思量自难忘°
    2020-12-01 04:28

    If you have a new database and you make a fresh clean import, the problem may come from inserting data that contains a '0' incrementation and this would transform to '1' with AUTO_INCREMENT and cause this error.

    My solution was to use in the sql import file.

    SET SESSION sql_mode='NO_AUTO_VALUE_ON_ZERO';
    

提交回复
热议问题