访问与蒙戈客户端确定管理员,失败,mongorestore

问题描述 投票:1回答:1

使用蒙戈客户端,我可以用我的管理员帐户成功验证:

$ mongo -u my_admin_username -p my_admin_pass --authenticationDatabase admin
MongoDB shell version: 2.6.3
connecting to: test
> 

但是当我尝试用相同的凭据执行mongorestore,它失败:

$ mongorestore -u my_admin_username -p my_admin_pass /backup/20140821/db/myproject/
connected to: 127.0.0.1
assertion: 13 not authorized on admin to execute command { getParameter: 1, authSchemaVersion: 1 }

这是为什么?我在想什么?我想成功执行mongorestore。

mongodb mongorestore
1个回答
0
投票
$ mongorestore -u my_admin_username -p my_admin_pass /backup/20140821/db/myproject/ -db myproject

这个工作。

© www.soinside.com 2019 - 2024. All rights reserved.