Mongo --port 27012 -u "m103-admin" -p "m103-pass" --authenticationDatabase "admin" MongoDB shell version v3.6.12


can anyone help?
mongo --port 27012 -u “m103-admin” -p “m103-pass” --authenticationDatabase “admin”
MongoDB shell version v3.6.12
connecting to: mongodb://
2019-04-29T11:22:45.406+0000 E QUERY [thread1] Error: Authentication failed. :
exception: connect failed

Please make sure m103-admin user is created in the mongo db.

can you explain how can i check that?

you won’t be able to login if m103-admin is not created. please create m103-admin user as outlined in the course.

1 Like

Thanks, it works.
my second problem is that i cant shutdown the db, maybe it because i connected to Primary node.
MongoDB Enterprise m103-repl:PRIMARY> db.shutdownServer()
2019-04-29T12:15:12.046+0000 E QUERY [thread1] Error: shutdownServer failed: {
“ok” : 0,
“errmsg” : “No electable secondaries caught up as of 2019-04-29T12:15:12.045+0000Please use the replSetStepDown command with the argument {force: true} to force node to step down.”,
“code” : 50,
“codeName” : “ExceededTimeLimit”
} :

Its not because of Primary. Secondaries are not sync with Primary.

Hi @Tal_38236,

Your command looks fine but please make sure to check for the following things:

  1. You should be able to use db.shutdownServer() while connected to the primary node but ensure that the current database is admin.

  2. Also make sure that all your secondary nodes are working when you are trying to shutdown the primary node. You can check the details of the replica set member using the rs.status() command.

Please refer to the docs below for more information:

If you are still facing the same issue, please let me know.