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

将MySQL数据导入MongoDB

时间:2015-09-11 12:36:56      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:

1、进入Mysql,将数据导成CVS

select * from test_info into outfile ‘/tmp/test.csv‘ fields terminated by ‘,‘ optionally enclosed by ‘"‘ escaped by ‘"‘ lines terminated by ‘\r\n‘; 
 
2、将CVS导入到Mongodb中
E:\mydrive\Project\HouseDataManageSystem\DB\mongoDB\bin\mongoexport -h "127.0.0.1:16688" -u"username" -p "password" -d "hdms" -c "MS_Updatelog" -f "Up_id,Up_content,Up_Updatetime" -type=csv -file=d:\MS_UpdateLog.csv

将MySQL数据导入MongoDB

标签:

原文地址:http://www.cnblogs.com/spzhangfei/p/4800446.html

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