zoukankan      html  css  js  c++  java
  • mongodb错误解决方案

    问题描述:

    因为一段时间没有使用MongoDB数据库,所以今天出现一个问题,在进入MongoDB数据库后执行show dbs等命令基本都会出现一个错误,如下:

    MongoDB Enterprise > show dbs;
    2018-05-19T12:05:01.313+0800 E QUERY [thread1] Error: listDatabases failed:{
    "ok" : 0,
    "errmsg" : "not authorized on admin to execute command { listDatabases: 1.0, $db: "admin" }",
    "code" : 13,
    "codeName" : "Unauthorized"
    } :
    _getErrorWithCode@src/mongo/shell/utils.js:25:13
    Mongo.prototype.getDBs@src/mongo/shell/mongo.js:65:1
    shellHelper.show@src/mongo/shell/utils.js:820:19
    shellHelper@src/mongo/shell/utils.js:710:15
    @(shellhelp2):1:1

    我到现在也不知道具体错在哪里,看错误像权限问题,但按照网上的一些权限方法解决,没有用。

    最后,我的MongoDB安装步骤是按照百度https://jingyan.baidu.com/article/d5c4b52bef7268da560dc5f8.html装的,我就把其中的data数据和log数据删除,重新建立新的文件,再将服务重新安装。前提是你必须把数据库先关闭。这样就解决了。

  • 相关阅读:
    js五种继承优缺点
    golang---panic/recover
    golang---应用OOM
    golang--- context
    常用工具及日常
    golang --- pipline
    golang 竞争---翻译
    深入golang之---goroutine并发控制与通信
    rpm打包
    k8s-operator指北
  • 原文地址:https://www.cnblogs.com/pig1314/p/9059972.html
Copyright © 2011-2022 走看看