登录mongo,也db.auth() 验证OK,但是无法执行命令。 db.serverStatus() 需要root权限才可以使用 给admin添加root权限: db.system.users.find() db.grantRolesToUser( "admin" , [ { role: "root", db: "admin" } ])
"errmsg":"not authorized on admin to execute command { find: \"system.version\", filter: { _id: \"shardIdentity\" }, lsid: { id: UUID(\"db3f050d-1c97-712d-8ad3-9c9df27d6c67\") }, $clusterTime: { clusterTime: Timestamp(1662603775, 1), signature: { hash: BinData(0, 1B73...
针对你提出的“mongoservererror: not authorized on admin to execute command”错误,我们可以从以下几个方面进行排查和解决: 确认MongoDB实例是否启用了身份验证: MongoDB可以在配置时选择是否启用身份验证。如果MongoDB实例启用了身份验证,那么任何试图连接到数据库的操作都需要提供有效的用户名和密码。如果未启用身份...
MongoDB6.0报错:“mongo” 不是内部或外部命令,也不是可运行的程序或批处理文件。 mongodb not authorized not authorized on admin to execute command { listCollections: 1.0, filter: {}, $db: \"admin\" } 重新操作
【MongoDB】日志报错not authorized on admin to execute command 第一步 useadmin 第二步
mongodb 不存在 mongodb not authorized on 上篇文章讲到了mongodb的安装和默认启动。 这篇文章主要是解决在测试使用mongodb的时候,总是出现的MongoAuthenticationException 异常和 not authorized for query,not authorized on admin to execute command 等问题。
角色授权分两种,一种是直接在当前库中创建用户并授予相关权限。如admin库中创建admin用户。另一种情况是 将在admin中创建的用户授予操作其他库的权限,相关授权命令如下: 授予角色: 代码语言:javascript 代码运行次数:0 复制 Cloud Studio代码运行 db.grantRolesToUser("userName",[{role:"<role>",db:"<database>...
this plugin. I've got it to the point where I'm trying to get "http://localhost:8080/" from the server. Unfortunately, the Mongo plugin returns 'The full response is { "ok" : 0.0, "errmsg" : "not authorized on admin to execute command { listDatabases: 1 }", "code" : 13 }'...
Mongodb默认是不需要用户密码就可以连接的,如果使用命令报错"not authorized on admin to execute command ",则表示当前登陆用户不具备相应权限; 解决办法:通过创建一个用户,赋予用户root权限 注意:在createUser之前先use admin切换一下。 db.createUser({user:"root", ...
>use admin >db.auth('root','123456') > var schema=db.system.version.findOne({"_id" : "authSchema"}) Y> schema.currentVersion = 3 3 > db.system.version.save(schema) WriteResult({ "writeError" : { "code" : 13, "errmsg" : "not authorized on root to execute command { update:...