使用insert ignore来避免向数据库重复插入数据时间:2023-03-08 23:50:50 mysql中 insert ignore 的使用示例如下: INSERT IGNORE INTO `table_name` (`reportid`, `content`) VALUES (‘11111’,‘hello’); 需要注意的是,如果对应的表没有加唯一索引或者相应主键的话,insert ignore是不起作用的。