Problem Description:
Because the MongoDB database is not used for some time, there is a problem today, after entering the MongoDB database, execute show DBS and other commands basically will appear an error, as follows:
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"
} :
[Email protected]/mongo/shell/utils.js:25:13
[Email protected]/mongo/shell/mongo.js:65:1
[Email protected]/mongo/shell/utils.js:820:19
[Email protected]/mongo/shell/utils.js:710:15
@ (SHELLHELP2): 1:1
I do not know where the specific fault, see the error like permissions, but according to some of the permissions on the internet to solve, no use.
Finally, my MongoDB installation step is according to Baidu Https://jingyan.baidu.com/article/ d5c4b52bef7268da560dc5f8.html, I'll delete the data and log data, reestablish the new file, and reinstall the service. The premise is that you must shut down the database first. This will solve the problem.
MongoDB Error Solution