Closed Stephanevg closed 2 years ago
Hi, I was following the basics training for mongodb, and need to connect to an atlas cluster.
using the mongosh shell, i can connect no problem using the following command:
.\mongosh "mongodb+srv://sandbox.datdk.mongodb.net/myFirstDatabase" --username m001-student
I get prompted for the password, put it in, and can connect.
I wanted to accomplish the same thing using mdbc:
I tried quite a few ways in order to establish the connection, but i keep getting errors:
Connect-Mdbc -ConnectionString "mongodb+srv://sandbox.datdk.mongodb.net/myFirstDatabase" Connect-Mdbc : Query 34620 => sandbox.datdk.mongodb.net IN TXT on 192.168.1.254:53 failed with an error. At line:1 char:1 + Connect-Mdbc -ConnectionString "mongodb+srv://sandbox.datdk.mongodb.n ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-Mdbc], DnsResponseExcep tion + FullyQualifiedErrorId : DnsClient.DnsResponseException,Mdbc.Commands.Conne ctCommand
Connect-Mdbc -ConnectionString "mongodb+srv://sandbox.datdk.mongodb.net/" -DatabaseName "myFirstDatabase" Connect-Mdbc : Query 3694 => sandbox.datdk.mongodb.net IN TXT on 192.168.1.254:53 failed with an error. At line:1 char:1 + Connect-Mdbc -ConnectionString "mongodb+srv://sandbox.datdk.mongodb.n ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-Mdbc], DnsResponseExcep tion + FullyQualifiedErrorId : DnsClient.DnsResponseException,Mdbc.Commands.Conne ctCommand
Adding credentials in the connection string
Connect-Mdbc -ConnectionString "mongodb+srv://m001-student:m001-mongodb-basics@sandbox.datdk.mongodb.net" -DatabaseName "myFirstDatabase" Connect-Mdbc : Query 3698 => sandbox.datdk.mongodb.net IN TXT on 192.168.1.254:53 failed with an error. At line:1 char:1 + Connect-Mdbc -ConnectionString "mongodb+srv://m001-student:m001-mongo ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-Mdbc], DnsResponseExcep tion + FullyQualifiedErrorId : DnsClient.DnsResponseException,Mdbc.Commands.Conne ctCommand
could someone point me to what i am doing wrong here?
thanks in advance!
Sorry for the delay (vacation). Unfortunately I do not know how to help. Out of curiosity, what happens if you try to connect using mongo shell and your connection string with embedded creds in it?
Hi, I was following the basics training for mongodb, and need to connect to an atlas cluster.
using the mongosh shell, i can connect no problem using the following command:
I get prompted for the password, put it in, and can connect.
I wanted to accomplish the same thing using mdbc:
I tried quite a few ways in order to establish the connection, but i keep getting errors:
Adding credentials in the connection string
could someone point me to what i am doing wrong here?
thanks in advance!