Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Will Not Implement
Categories MongoDB Shell
Created by Guest
Created on Oct 26, 2020

db connection issue

i am trying to connect mongo cloud training database using shell propt, i am getting error as below. have added my laptop ip, and its approved in the cloud instnace but still getting errorl C:\Users\pvenket1>mongo "mongodb+srv://sandbox.9k9vj.mongodb.net/sample_training" --username m001-student --password password: m001-mongodb-basics MongoDB shell version v4.4.1 connecting to: mongodb://sandbox-shard-00-00.9k9vj.mongodb.net:27017,sandbox-shard-00-01.9k9vj.mongodb.net:27017,sandbox-shard-00-02.9k9vj.mongodb.net:27017/sample_training?authSource=admin&compressors=disabled&gssapiServiceName=mongodb&replicaSet=atlas-s4l3gu-shard-0&ssl=true *** It looks like this is a MongoDB Atlas cluster. Please ensure that your IP whitelist allows connections from your network. Error: can't connect to new replica set master [sandbox-shard-00-01.9k9vj.mongodb.net:27017], err: AuthenticationFailed: bad auth : Authentication failed. : connect@src/mongo/shell/mongo.js:374:17 @(connect):2:6 exception: connect failed exiting with code 1
  • ADMIN RESPONSE
    Oct 18, 2025
    Command has an error. The correct command is: mongo "mongodb+srv://sandbox.9k9vj.mongodb.net/sampletraining" --username m001-student --password m001-mongodb-basics or if you are using mongosh: mongosh "mongodb+srv://sandbox.9k9vj.mongodb.net/sampletraining" --username m001-student --password m001-mongodb-basics