简体   繁体   中英

How solve connect Mongodb cluster by mongo shell method

I have a something problem. While I created Cluster on MongoDB Atlas then i have to connect to mongo shell. When i copy string on mongodb box and paste in my command line for connect mongoDB and my source but when i insert my password it show MongoNetworkError. What it's problem. Anyone can help me please!

mongosh "mongodb+srv://cluster1.xlavu.mongodb.net/myFirstDatabase" --apiVersion 1 --username BoroBlade

Enter password: ****************
Current Mongosh Log ID: 62f260cd5921dc2cd9212885
Connecting to: mongodb+srv://<credentials>@cluster1.xlavu.mongodb.net/myFirstDatabase?appName=mongosh+1.5.4
MongoNetworkError: connection 1 to 18.140.129.75:27017 closed

You are specifying the database myFirstDatabase . Mongosh is using that database for authentication. Most likely MongoDB is using the admin database for authentication.

Add the command line option:

--authenticationDatabase admin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM