Mongo db碰到的一些问题

mongo 的总结

1.权限不够Error:couldn't add user:command createUser requires authentication、

解决方案:先使用超级管理员登录,再进行其他数据库用户创建的创建。

 

 2

[js] Error: shutdownServer failed: {
"ok" : 0,
"errmsg" : "too many users are authenticated",
"code" : 13,
"codeName" : "Unauthorized"
}

先退出 命令行,然后重新进入认证,只认证一个用户,不要多次使用db.auth()认证多个用户

 
3.Warning: unable to run listCollections, attempting to approximate collection
在mongodb中参数查看数据库中的表是报错:

Warning: unable to run listCollections, attempting to approximate collection names by parsing connectionStatus

那是因为设置了密码,但是没有进行认证导致的错误。这个错误为啥不直接说明原因呢。汗
 
直接: db.auth('admin','密码')
认证成功返回1, 然后重新执行show tables就可以看到所有的表了。
posted @ 2021-03-10 17:12  天道酬勤,坚持!  阅读(1174)  评论(0编辑  收藏  举报