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数据删除,重新建立新的文件,再将服务重新安装。前提是你必须把数据库先关闭。这样就解决了。

  • 相关阅读:
    c/c++ const
    Lucene2.9.1使用小结(同样适用于Lucene 3.0 )
    java 对properties 文件的写操作
    oracle 建表序列插入值
    jxl 读取2003 excel 示例
    HttpClient 的使用
    小故事
    iText 导出word 经典实现
    使用dom4j 解析xml
    lucene 在项目中的使用
  • 原文地址:https://www.cnblogs.com/pig1314/p/9059972.html
Copyright © 2011-2022 走看看