首先我們要先安裝mongo shell
具體怎么下載安裝大家可以參考這個(gè) Link
本章節(jié)不做過多解釋
接下來我們來到bin目錄
cd C:\mongodb\bin
添加我們的pem file進(jìn)bin目錄
接下來開始連接
mongo -u admin -p $PASSWORD --ssl --sslCAFile japanese.pem --authenticationDatabase admin --host replset/bd574ce4-7b36-4274-9976-96db98a3ac10-0.b8a5e798d2d04f2e860e54e5d042c915.databases.appdomain.cloud:30484,bd574ce4-7b36-4274-9976-96db98a3ac10-1.b8a5e798d2d04f2e860e54e5d042c915.databases.appdomain.cloud:30484
- mongo - The command itself.
- --ssl --sslCAFile - The path and name of the self-signed certificate for your deployment.
- -u - The parameter for the username.
- -p - The parameter for the password.
- --authenticationDatabase - The database where the user and its credentials are created and stored.
- --host - The replica set name, followed by a /, and the hosts of the replica set members.