如何在putty上通过控制台访问服务器上的数据库mongodb?

问题描述 投票:1回答:1

我想通过putty在服务器暂存上访问数据库mongodb。但我仍然对设置它感到困惑

看这个 :

enter image description here

需要在那里设置什么?

我想要一个完整的解释

或许还有另一种更好的方式来访问mongodb?

database mongodb remote-access putty ssh-keys
1个回答
1
投票

使用Putty,您可以在运行MongoDB服务器的服务器上创建SSH会话,因此您无法直接使用Putty连接到MongoDB服务器。您可以执行以下操作:

First Solution

  1. 使用SSH连接到运行MongoDb的服务器(粘贴在Putty窗口中的主机名或IP地址并连接到端口22)
  2. 使用此服务器上的服务器凭据登录
  3. 在服务器上使用mongo命令行工具并连接到MongoDB服务器

Second solution (therefore your MongoDB port has to be accessable from the internet and you need the mongo CLI tool on your machine)

  1. 在笔记本电脑/台式电脑上打开CMD
  2. 使用mongo yourMongoDbServerHostname:Port/dbname -u dbuser -p dbpassword并创建与远程MongoDb服务器的连接

如果您正在寻找Mongo GUI客户端,请查看:https://robomongo.org/https://www.mongodb.com/products/compass

如果这不起作用,请提供有关MongoDb服务器的更多信息。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.