码迷,mamicode.com
首页 > 数据库 > 详细

从csv文件导数据到MySQL

时间:2015-03-31 12:06:53      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

 导入:

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‘; 

从csv文件导数据到MySQL

标签:

原文地址:http://www.cnblogs.com/Jshujiao/p/4380175.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!