解决:
use admin
db.createRole(
{
role: "interalUseOnlyOplogRestore",
privileges: [
{ resource: { anyResource: true }, actions: [ "anyAction" ] }
],
roles: []
}
)
db.createUser({
user: "root2",
pwd: "password",
roles: [
"interalUseOnlyOplogRestore"
]
})