assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }
来源:互联网 发布:出国留学知乎 编辑:程序博客网 时间:2024/06/12 01:30
当开启auth后,执行mongodump,mongorestore时有如下错误”assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }“
其实就是认证失败嘛
执行mongodump --help后发现问题,添加authenticationDatabase就好了
#mongodump -u root -p passwd--authenticationDatabase admin -d test -o /mnt/mongdb
mongorestore -u root -p passwd --authenticationDatabase admin -d test /mnt/mongdb
备注,如果测试用,最好使用--authenticationDatabase admin,实际生产环境,最好新建账号作业
windows下也遇到过类似错误,原因是.bat里面密码处引用了''(单引号号);
2 0
- assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }
- uncaught exception: listDatabases failed:{ "errmsg" : "need to login", "ok" : 0 }
- CreateCompatibleBitmap Fails with Err code 8
- 微信公众号{"errcode":40029,"errmsg":"invalid code"} ? 微信公众号错误提示:{"errcode":40029,"errmsg":"invalid code"}
- rs.initiate(config); {"ok" : 0, "errmsg" : "couldn't initiate : need all members up to initiate, not
- 【w1】微信公众号接口-微信接口怎么设置不弹出{“errMsg”:"config:ok"}
- Assertion
- Windows CE: LoadLibrary Fails with Error Code 193
- Windows CE: LoadLibrary Fails with Error Code 193
- MySQL:Foreign key fails with error Error Code: 1452.
- SQL Server cluster failover fails with Error Code: 0x80071398
- About OK Code Values in SAP
- SAP标准OK Code Values 列表
- SAP标准OK Code Values 列表
- SAP标准OK Code Values 列表
- SAP标准OK Code Values 列表
- SAP标准OK Code Values 列表
- (OK) Building Android from AOSP source code
- 分析iOS Crash文件:符号化iOS Crash文件的3种方法(转修)
- cocos2dx 编译出错
- 用SQLyogEnt备份恢复数据库问题
- ssh-keygen 用法
- 三款经典了国内萨迪克个你sad控股那事大法官
- assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }
- 生成文件-java自动生成多个相同文件
- Selenium 中文API
- hibernate中PO(持久化对象)与POJO(普通的JavaBean)
- 破解优酷土豆播放器过程
- Python超级程序员使用的开发工具
- 关于shm_open和shm_unlink的使用问题
- Oracle 11g新特性虚拟列分区
- 直接插入排序