![从csv文件导数据到MySQL 从csv文件导数据到MySQL](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
导入:
load data local infile 'D:\\top-1m.csv' (注意要加上local)10.21.
into table `site`
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\n';
导出:
select * from `site`
into local outfile 'D:\\top-1m.csv'
fields terminated by ',' optionally enclosed by '"' escaped by '"'
lines terminated by '\n';