码迷,mamicode.com
首页 > 其他好文 > 详细

assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }

时间:2014-11-11 19:19:31      阅读:293      评论:0      收藏:0      [点我收藏+]

标签:style   io   使用   sp   on   问题   bs   ad   size   

当开启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,实际生产环境,最好新建账号作业

assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }

标签:style   io   使用   sp   on   问题   bs   ad   size   

原文地址:http://blog.csdn.net/jacson_bai/article/details/41013259

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!