从mysql导入数据到mongodb

来源:互联网 发布:服务业知乎 编辑:程序博客网 时间:2024/05/20 07:16

从mysql导出文件:

select item1,item2,item3... from TABLE into outfile 'DATA.csv' fields terminated by ',' optionally enclosed by '' escaped by '' lines terminated by '\r\n';

导入mongodb:

mongoimport -u USER -p PASSWORD -d DB -c COLLECTION -f item1,item2,item3... --type csv --file "DATA.csv"
原创粉丝点击