【发布时间】:2017-02-19 06:10:35
【问题描述】:
我通过Bitnami script 在 Google Cloud Compute Engine 上安装了 MongoDB。我可以在 Google Cloud 仪表板中看到 vm 实例。我可以使用我部署的 node.js 应用程序连接到数据库。我的应用程序运行良好。
我想不通的是如何独立验证 Mongo 数据库中的内容。
在 Mongo DB VM 的 Compute Cloud 仪表板上,屏幕顶部有一个 SSH 下拉按钮。单击此按钮将打开一个浏览器框架。框架通过 https 连接到 VM 实例,并确认登录信息。我见过this related stackoverflow posting,我已经遇到了所有这些建议。在 Google Cloud VM 实例界面上确认的设置。当我输入 mongo 时,我可以看到 mongo shell。当我尝试show dbs 时,我得到了意想不到的结果:
show dbs
2017-02-19T05:51:45.161+0000 E QUERY [thread1] Error: listDatabases failed:{
"ok" : 0,
"errmsg" : "not authorized on admin to execute command { listDatabases: 1.0 }",
"code" : 13,
"codeName" : "Unauthorized"
} :
我怎样才能做一个简单的show dbs然后show collections最后db.foo.find()来确认数据内容?
【问题讨论】:
标签: mongodb google-cloud-platform google-compute-engine