1. 利用mysqlimport --local dbname data.txt导入数据到表中,表名要与文件名一致
2. 执行下列sql语句(要求唯一的字段为uniqfield)
复制代码
代码如下:use dbname;
alter table tablename add rowid int auto_increment not null;
create table t select min(rowid) as rowid from tablename group by uniqfield;
create table t2 select tablename .* from tablename,t where tablename.rowid= t.rowid;
drop table tablename;
rename table t2 to tablename;




![RedHat服务器上[Errno 5] OSError: [Errno 2]的解决方法](https://img.pc-daily.com/uploads/allimg/4752/11135115c-0-lp.png)

