I have a documentdb cluster, I m unable to connect to documentDB when I pass username and password args at once
mongo --host <myDocDbHost>:27017 --username admin --password <myPassword>
I get following error
connecting to: mongodb://< myDocDbHost>:27017/?gssapiServiceName=mongodb
2021-10-26T21:09:17.228+0000 E QUERY [js] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:356:17
@(connect):2:6
exception: connect failed
Where as when I try
mongo --host <myDocDbHost>:27017 --username admin
and enter password in next prompt where it asks for Password I m able to connect. I verified that I m using the correct password in both cases. I had same issue when I tried to connect directly from EC2 instance in same VPC as documentDB and through ssh tunneling as well. Can someone help me connect to db by passing both username and password args at once