导出
select field1,field2,field3 from tablename into outfile '/home/output1.csv' fields terminated by ','optionally enclosed by ''lines terminated by '/n';
导入
load data local infile '/home/output1.csv' into table tablename fields terminated by ','lines terminated by '/n'(field1,field2,field3);
注意:
1.写文件的目标目录需要是mysql拥有写权限的目录。