一: mysql导入数据load data infile用法
导出一张表的数据,以',' 为分隔符
select * from pet into outfile 'c:/pet.txt' fields terminated by ',' lines terminated by '\r\n';
select * from pet into outfile 'c:/pet1.txt' fields terminated by ',' enclosed by '"' lines terminated by '\r\n';
enclosed by '"' : 数据导出都是带 引号的 "Fluffy","Harold","cat","f","1993-02-04"
导入一张表的数据,以',' 为分隔符
load data local infile 'c:/
pet.txt' into table pet fields terminated by ',' lines terminated by '\r\n'
load data local infile 'c:/pet.txt' into table pet fields terminated by ',' lines terminated by '\r\n' (name,owner,species,sex,birth,death) ;
load data local infile 'c:/
pet1.txt' into table pet fields terminated by ',' enclosed by '"' lines terminated by '\r\n';
enclosed by'"' 导入带引号 "Fluffy","Harold",