Connecting using MongoDB Compass












4















I'm trying to see the contents of a collection using MongoDB Compass. I have username/password authentication set up. I can log in successfully but can't see any documents in the collection. Instead, I see the error:




An error occurred while loading navigation: command hostInfo requires
authentication.




Here are the list of roles the user has:



"roles": [{
"role": "readWrite",
"db": "moviesDB"
},
{
"role": "dbAdmin",
"db": "moviesDB"
},
{
"role": "dbOwner",
"db": "moviesDB"
},
{
"role": "clusterMonitor",
"db": "admin"
},
{
"role": "dbAdmin",
"db": "moviesDB"
}
]


I can successfully query the collection using mongo shell and node.js driver but not through Compass. If someone could tell me what I'm doing wrong I'd appreciate it. Thanks in advance!










share|improve this question

























  • can you share what all entries you made in mongodb compass?

    – richi arora
    Aug 21 '18 at 15:29
















4















I'm trying to see the contents of a collection using MongoDB Compass. I have username/password authentication set up. I can log in successfully but can't see any documents in the collection. Instead, I see the error:




An error occurred while loading navigation: command hostInfo requires
authentication.




Here are the list of roles the user has:



"roles": [{
"role": "readWrite",
"db": "moviesDB"
},
{
"role": "dbAdmin",
"db": "moviesDB"
},
{
"role": "dbOwner",
"db": "moviesDB"
},
{
"role": "clusterMonitor",
"db": "admin"
},
{
"role": "dbAdmin",
"db": "moviesDB"
}
]


I can successfully query the collection using mongo shell and node.js driver but not through Compass. If someone could tell me what I'm doing wrong I'd appreciate it. Thanks in advance!










share|improve this question

























  • can you share what all entries you made in mongodb compass?

    – richi arora
    Aug 21 '18 at 15:29














4












4








4








I'm trying to see the contents of a collection using MongoDB Compass. I have username/password authentication set up. I can log in successfully but can't see any documents in the collection. Instead, I see the error:




An error occurred while loading navigation: command hostInfo requires
authentication.




Here are the list of roles the user has:



"roles": [{
"role": "readWrite",
"db": "moviesDB"
},
{
"role": "dbAdmin",
"db": "moviesDB"
},
{
"role": "dbOwner",
"db": "moviesDB"
},
{
"role": "clusterMonitor",
"db": "admin"
},
{
"role": "dbAdmin",
"db": "moviesDB"
}
]


I can successfully query the collection using mongo shell and node.js driver but not through Compass. If someone could tell me what I'm doing wrong I'd appreciate it. Thanks in advance!










share|improve this question
















I'm trying to see the contents of a collection using MongoDB Compass. I have username/password authentication set up. I can log in successfully but can't see any documents in the collection. Instead, I see the error:




An error occurred while loading navigation: command hostInfo requires
authentication.




Here are the list of roles the user has:



"roles": [{
"role": "readWrite",
"db": "moviesDB"
},
{
"role": "dbAdmin",
"db": "moviesDB"
},
{
"role": "dbOwner",
"db": "moviesDB"
},
{
"role": "clusterMonitor",
"db": "admin"
},
{
"role": "dbAdmin",
"db": "moviesDB"
}
]


I can successfully query the collection using mongo shell and node.js driver but not through Compass. If someone could tell me what I'm doing wrong I'd appreciate it. Thanks in advance!







mongodb database-connection database-administration mongodb-compass






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 17 '18 at 20:02









Akrion

9,41711224




9,41711224










asked Aug 17 '18 at 19:59









wiccckedwicccked

408




408













  • can you share what all entries you made in mongodb compass?

    – richi arora
    Aug 21 '18 at 15:29



















  • can you share what all entries you made in mongodb compass?

    – richi arora
    Aug 21 '18 at 15:29

















can you share what all entries you made in mongodb compass?

– richi arora
Aug 21 '18 at 15:29





can you share what all entries you made in mongodb compass?

– richi arora
Aug 21 '18 at 15:29












2 Answers
2






active

oldest

votes


















1














I too got stucked in the same problem. It helped me out:-



Try this
cmd-1:



use admin
db.createUser({
user: "newUsername",
pwd: "password",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
})


cmd-2:



db.grantRolesToUser('newUsername',[{ role: "root", db: "admin" }])


Let me know if this also helps you out.






share|improve this answer
























  • Also try by killing the MongoDBCompassCommunity.exe from processes and then restart your compass again and try login with credentials.

    – Abhishek_Itachi
    Sep 17 '18 at 10:32











  • The first option worked! (I didn't try the second one) Thank you so much! I already gave up hope to have it resolved =)

    – wicccked
    Sep 17 '18 at 12:03






  • 2





    Restarting MongoDB Compass solved the issue for me. Just updating the MongoDB access rights correctly was not enough, but Compass restart was needed.

    – Jarno P.
    Oct 28 '18 at 10:10



















3














Kill the mongodb compass processes running, and re-launch compass.






share|improve this answer



















  • 1





    this saved me the day!

    – ace
    Jan 5 at 10:36











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51902136%2fconnecting-using-mongodb-compass%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














I too got stucked in the same problem. It helped me out:-



Try this
cmd-1:



use admin
db.createUser({
user: "newUsername",
pwd: "password",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
})


cmd-2:



db.grantRolesToUser('newUsername',[{ role: "root", db: "admin" }])


Let me know if this also helps you out.






share|improve this answer
























  • Also try by killing the MongoDBCompassCommunity.exe from processes and then restart your compass again and try login with credentials.

    – Abhishek_Itachi
    Sep 17 '18 at 10:32











  • The first option worked! (I didn't try the second one) Thank you so much! I already gave up hope to have it resolved =)

    – wicccked
    Sep 17 '18 at 12:03






  • 2





    Restarting MongoDB Compass solved the issue for me. Just updating the MongoDB access rights correctly was not enough, but Compass restart was needed.

    – Jarno P.
    Oct 28 '18 at 10:10
















1














I too got stucked in the same problem. It helped me out:-



Try this
cmd-1:



use admin
db.createUser({
user: "newUsername",
pwd: "password",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
})


cmd-2:



db.grantRolesToUser('newUsername',[{ role: "root", db: "admin" }])


Let me know if this also helps you out.






share|improve this answer
























  • Also try by killing the MongoDBCompassCommunity.exe from processes and then restart your compass again and try login with credentials.

    – Abhishek_Itachi
    Sep 17 '18 at 10:32











  • The first option worked! (I didn't try the second one) Thank you so much! I already gave up hope to have it resolved =)

    – wicccked
    Sep 17 '18 at 12:03






  • 2





    Restarting MongoDB Compass solved the issue for me. Just updating the MongoDB access rights correctly was not enough, but Compass restart was needed.

    – Jarno P.
    Oct 28 '18 at 10:10














1












1








1







I too got stucked in the same problem. It helped me out:-



Try this
cmd-1:



use admin
db.createUser({
user: "newUsername",
pwd: "password",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
})


cmd-2:



db.grantRolesToUser('newUsername',[{ role: "root", db: "admin" }])


Let me know if this also helps you out.






share|improve this answer













I too got stucked in the same problem. It helped me out:-



Try this
cmd-1:



use admin
db.createUser({
user: "newUsername",
pwd: "password",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
})


cmd-2:



db.grantRolesToUser('newUsername',[{ role: "root", db: "admin" }])


Let me know if this also helps you out.







share|improve this answer












share|improve this answer



share|improve this answer










answered Sep 17 '18 at 10:28









Abhishek_ItachiAbhishek_Itachi

896




896













  • Also try by killing the MongoDBCompassCommunity.exe from processes and then restart your compass again and try login with credentials.

    – Abhishek_Itachi
    Sep 17 '18 at 10:32











  • The first option worked! (I didn't try the second one) Thank you so much! I already gave up hope to have it resolved =)

    – wicccked
    Sep 17 '18 at 12:03






  • 2





    Restarting MongoDB Compass solved the issue for me. Just updating the MongoDB access rights correctly was not enough, but Compass restart was needed.

    – Jarno P.
    Oct 28 '18 at 10:10



















  • Also try by killing the MongoDBCompassCommunity.exe from processes and then restart your compass again and try login with credentials.

    – Abhishek_Itachi
    Sep 17 '18 at 10:32











  • The first option worked! (I didn't try the second one) Thank you so much! I already gave up hope to have it resolved =)

    – wicccked
    Sep 17 '18 at 12:03






  • 2





    Restarting MongoDB Compass solved the issue for me. Just updating the MongoDB access rights correctly was not enough, but Compass restart was needed.

    – Jarno P.
    Oct 28 '18 at 10:10

















Also try by killing the MongoDBCompassCommunity.exe from processes and then restart your compass again and try login with credentials.

– Abhishek_Itachi
Sep 17 '18 at 10:32





Also try by killing the MongoDBCompassCommunity.exe from processes and then restart your compass again and try login with credentials.

– Abhishek_Itachi
Sep 17 '18 at 10:32













The first option worked! (I didn't try the second one) Thank you so much! I already gave up hope to have it resolved =)

– wicccked
Sep 17 '18 at 12:03





The first option worked! (I didn't try the second one) Thank you so much! I already gave up hope to have it resolved =)

– wicccked
Sep 17 '18 at 12:03




2




2





Restarting MongoDB Compass solved the issue for me. Just updating the MongoDB access rights correctly was not enough, but Compass restart was needed.

– Jarno P.
Oct 28 '18 at 10:10





Restarting MongoDB Compass solved the issue for me. Just updating the MongoDB access rights correctly was not enough, but Compass restart was needed.

– Jarno P.
Oct 28 '18 at 10:10













3














Kill the mongodb compass processes running, and re-launch compass.






share|improve this answer



















  • 1





    this saved me the day!

    – ace
    Jan 5 at 10:36
















3














Kill the mongodb compass processes running, and re-launch compass.






share|improve this answer



















  • 1





    this saved me the day!

    – ace
    Jan 5 at 10:36














3












3








3







Kill the mongodb compass processes running, and re-launch compass.






share|improve this answer













Kill the mongodb compass processes running, and re-launch compass.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 20 '18 at 19:30









barrypickerbarrypicker

4,36624153




4,36624153








  • 1





    this saved me the day!

    – ace
    Jan 5 at 10:36














  • 1





    this saved me the day!

    – ace
    Jan 5 at 10:36








1




1





this saved me the day!

– ace
Jan 5 at 10:36





this saved me the day!

– ace
Jan 5 at 10:36


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51902136%2fconnecting-using-mongodb-compass%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

The term 'EXEC' is not recognized as the name of a cmdlet Powershell

NPM command prompt closes immediately [closed]

Error binding properties and functions in emscripten