Home > AMP

Mysql 导入导出csv

导出csv

select * from test_info
into outfile ‘/tmp/test.csv’
fields terminated by ‘,’ optionally enclosed by ‘”‘ escaped by ‘”‘
lines terminated by ‘\n’;
导入csv

load data local infile ‘/tmp/test.csv’
into table test_info
CHARACTER SET utf8
fields terminated by ‘,’ optionally enclosed by ‘”‘ escaped by ‘”‘
lines terminated by ‘\n’;

随机文章:

发表评论