MongoDB中的数据导出为JSON文件时报错“Failed: not authorized on XXX to...”
2017-08-04 20:12
344 查看
先介绍一下问题背景。
今天在将微博数据爬下来存到MongoDB后,本想导出为JSON,结果报错“Failed: not authorized on weibo to …”,使用的命令是mongoexport -d weibo -c weibo1730726637. -o e:\code\730726637.json。
看报错信息知道可能是因为登录问题,使用
mongoexport --help查看各个参数,添加/authenticationDatabase admin 和用户名、密码之类信息之后,数据导出成功。
mongoexport /authenticationDatabase admin /h localhost /p 27017 /u username /p password /d database /c collection /o e:\data.json
相关文章推荐
- MongoDB not authorized on admin to execute command --auth Authentication failed.
- mongodb 报错 not authorized on admin to execute command【 version 3.2.18 】
- [MongoDB] not authorized on test to execute command-MongoDB的权限配置
- 远程从Mongodb 数据库导出数据为json文件
- mongodb 报错:Query failed with error code 13 and error message 'not authorized for query on ..."
- json数据类型 导致(xxx).ToLowerCase isnot a function
- mongodb-导出数据到csv文件或json文件
- Could not launch "xxx". process launch failed: timed out waiting for app to launch
- Failed to execute goal on project taotao-sso: Could not resolve dependencies for project com.taotao:
- Failed to write core dump. minidumps are not enabled by default on client version of windows
- Mongodb导出 Csv 或者 Json 文件
- ASP.NET WebApi 上传文件时异常 Failed to execute send on XMLHttpRequest 的一个处理方法
- can not find xxx.json file,或者文件读取失败,请检查后重新编译。
- Failed to install xxx.apk on device 'emulator-5554': timeout
- error: src refspec master does not match any. error: failed to push some refs to xxx
- Failed to install XXX.apk on device 'emulator-5554': timeout
- Kali dpkg-source: warning: failed to verify signature on xxx
- mongodb数据导出(jsonArray格式)
- maven出现:Failed to execute goal on project ...: Could not resolve dependencies for project ...
- vmware:Cannot open the disk 'XXX' or one of the snapshot disks it depends on. reason: failed to lock the file.