mysql 导入导出csv

导出:

select RESOURCE_ID_INT,RESOURCE_ID_CHAR,RESOURCE_TITLE from t_resource_info_wb
into outfile '/usr/local/test.csv'
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\r\n';

导入:

load data infile '/usr/local/test.csv'  
into table t_resource_info   
fields terminated by ','  optionally enclosed by '"' escaped by '"'  
lines terminated by '\r\n' (RESOURCE_ID_INT,RESOURCE_ID_CHAR,RESOURCE_TITLE);
(RESOURCE_ID_INT,RESOURCE_ID_CHAR,RESOURCE_TITLE)
按字段导入

你可能感兴趣的:(mysql 导入导出csv)