A solution for mysql to delete duplicate data from a Table: www.2cto.com Create TABLE: CREATE Table 'TT' ('id' int (11) default null, 'name' varchar (30) default null) ENGINE = InnoDB default charset = utf8 2 million data 1 million id from 1 to 100 w name is zz100 id from 1 to 100 name is zz100 million id from 1 to 100 w name is mike100 id from 1 to 100 name is the stored procedure of mike: added the sizes + 1 data entry. The name is paramsCREATE PROCEDURE pro_insert2 (in sizes int, in params varchar (30) begindeclare I int; start transaction; set I = 0; while I <= sizes doinsert into tt values (I, params); set I = I + 1; end while; commit; end www.2cto.com mysql command line operation: insert test data call pro_insert2 (1000000, 'zz '); call pro_insert2 (100, 'zz'); call pro_insert2 (1000000, 'Mike '); call pro_insert2 (100, 'Mike '); mysql> select count (*) from tt; + ---------- + | count (*) | + ---------- + | 2000204 | + ---------- + 1 row in set (0.00 sec) Create Table: create table 'tt2' ('id' int (11) default null, 'name' varchar (30) default null) ENGINE = InnoDB default charset = utf81 row in set (0.00 sec) mysql> insert into tt2 (select distinct * from tt); Query OK, 2000002 rows affected (51.55 sec) Records: 2000002 Duplicates: 0 Warnings: 0 mysql> drop table tt; Query OK, 0 rows affected (0.10 sec) mysql> alter table tt2 rename tt; query OK, 0 rows affected (0.09 sec) mysql> select count (*) from tt; + ---------- + | count (*) | + ---------- + | 2000002 | + ---------- + 1 row in set (2.54 sec) to this OK, this method is not very efficient, and we look forward to a more efficient method.