Getting Error While connecting MongoDB through x509 Authentication Method

Hi Team,

I am getting error while logging in Atlas Mongo DB “MongoAPIError: URI cannot contain options with no value

Below is the command for which i used to connect DB through Mongoshell

1.mongosh “mongodb+srv://hostname.mongodb.net/test?authMechanism=MONGODB-X509&authSource=$external&tls”

2.mongosh --tls --tlsCertificateFile <path_to_cert.pem> --tlsCertificateKeyFile <path_to_key.pem> --host .mongodb.net

Kindly some one help me to overcome this issue.

Thanks,
Krishnakumar K

Hi Team,

Now i am able to connect the MongoDB using below command, But i am unable to take dump database getting error can someone share me the mongodump command to take backup the database.

mongosh “mongodb+srv://hostname.mongodb.net/?authSource=%24external&authMechanism=MONGODB-X509&retryWrites=true&w=majority” --tls --tlsCertificateKeyFile x5091248.pem

Hi Team,

Now i am able to connect the MongoDB using below command, But i am unable to take dump database getting error can someone share me the mongodump command to take backup the database.

mongosh “mongodb+srv://hostname.mongodb.net/?authSource=%24external&authMechanism=MONGODB-X509&retryWrites=true&w=majority” --tls --tlsCertificateKeyFile x5091248.pem

Hi @KRISHNAKUMAR_K,

What is the error?

Check out the following Connect to a Cluster using Command Line Tools documentation.

Regards,
Jason