将mysql数据导入mongodb

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

你可能感兴趣的:(Mongodb)