mongoDB含ssl的连接
2020-04-13 本文已影响0人
龚达耶
首先我们要先安装mongo shell
具体怎么下载安装大家可以参考这个 Link
本章节不做过多解释
接下来我们来到bin目录
cd C:\mongodb\bin
添加我们的pem file进bin目录
image.png
接下来开始连接
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.