当前位置:首页 > 数据库 > 正文

mysql——某表所有记录的导出和导入——csv文件

2020-02-11 数据库

select * from cr01
into outfile C:/Users/del/Desktop/table1_data.csv
character set gb2312
fields terminated by , optionally enclosed by " escaped by "
lines terminated by rn

select * from cr01; delete from cr01;

load data infile C:/Users/del/Desktop/table1_data.csv into table cr01 character set gb2312 fields terminated by , optionally enclosed by " escaped by " lines terminated by rn;

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/SQL/14272.html