db.shutdownServer()报错

hope1234567hope 发布于 2015/09/15 10:14
阅读 890
收藏 0

在学mongodb。版本是version: 3.0.6

> use admin
switched to db admin
> db.auth('super','super');
1
> show dbs
admin  0.078GB
local  0.078GB
test   0.078GB


> db.shutdownServer();
assert failed : unexpected error: Error: shutdownServer failed: not authorized on admin to execute command { shutdown: 1.0 }
Error: assert failed : unexpected error: Error: shutdownServer failed: not authorized on admin to execute command { shutdown: 1.0 }
    at Error (<anonymous>)
    at doassert (src/mongo/shell/assert.js:11:14)
    at assert (src/mongo/shell/assert.js:20:5)
    at DB.shutdownServer (src/mongo/shell/db.js:212:9)
    at (shell):1:4
2015-09-15T08:08:53.788+0800 E QUERY    Error: assert failed : unexpected error: Error: shutdownServer failed: not authorized on admin to execute command { shutdown: 1.0 }
    at Error (<anonymous>)
    at doassert (src/mongo/shell/assert.js:11:14)
    at assert (src/mongo/shell/assert.js:20:5)
    at DB.shutdownServer (src/mongo/shell/db.js:212:9)
    at (shell):1:4 at src/mongo/shell/assert.js:13
请问这个错误怎么解决?

加载中
0
金玉良妍
金玉良妍

没权限

not authorized on admin to execute command { shutdown: 1.0 }

0
h
hope1234567hope

也看到没有权限,但是为啥没有权限啊?

db.createUser(
  {
    user: "super",
    pwd: "super",
    roles:
    [
      { role: "userAdminAnyDatabase", db: "admin" }
    ]
  }
)

我看你还调皮
我看你还调皮
这是有权限的吧!!!为何还是不能关闭!
返回顶部
顶部