将mysql数据导入mongodb

来源:互联网 发布:js new york中国有店吗 编辑:程序博客网 时间:2024/06/06 17:51
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
0 0
原创粉丝点击