mongoDB含ssl的连接

首先我们要先安装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.
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容