2016-01-21 30 views
4

似乎在这个线程(Accessing Meteor production database)的答案不再工作了,当你想访问流星生产数据库在2016年。我想访问一个流星生产数据库blah.meteor.com使用2016年访问流星生产数据库

meteor mongo blah.meteor.com

,而不是我所得到的是:

connecting to: sg-mother1-6243.servers.mongodirector.com:27017/blah_meteor_com 2016-01-18T15:21:49.884+0200 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1210 exception: login failed

然后我试图

meteor mongo --url blah.meteor.com

我得到用户名光标。我输入我的流星网站用户名,然后按回车键,然后获取密码光标。我为上面的用户名输入密码并按回车。我得到呈现以下网址:

mongodb://client-2ee8c14d:[email protected]godirector.com:27017/blah_meteor_com

每当我一次重新进入

流星蒙戈--url blah.meteor.com

我认为已经登录,并我刚刚得到了一个类似的网址,就像我上面介绍的那样。 我输入看过“流星蒙戈命令”文件:

meteor mongo --help

在本文档中我读下面一行:

Instead of opening a shell, specifying --url (-U) will return a URL suitable for an external program to connect to the database. For remote databases on deployed applications, the URL is valid for one minute.

其中的意思,我又回到了线程(stackoverflow.com /问题/ 11801278 /访问-流星生产数据库)我在beggining提到,念道:

"So what it's saying is, the url provided by running the command with the --url option is for connecting to the database by some external application, i.e. other than meteor."

我不知道还有什么其他的应用程序可以帮我连接到流星生产数据库比我以前在2015年做其他的,那就是:

meteor mongo blah.meteor.com

我读的地方,我可以用这一翻译蒙戈外壳,但我不知道如何打开它,我不知道当它与流星一起安装时,mongo安装目录。我正在使用linux(fedora)操作系统。

我如何在2016年访问流星生产数据库?是否有升级发生,使我无法像2015年那样轻松访问流星生产数据库?

回答

4

您正在试图连接到3.0数据库版本,而您的meteor mongo命令仍然使用蒙戈

的版本2.6.7尝试以下解决方法:

  • 直接安装蒙戈版本(3.X)在你的机器上。
  • 然后运行这个命令(安装的sed时在OSX,Linux和Windows应工作):

    mongo `meteor mongo --url XXX.meteor.com | sed 's/mongodb:\/\//-u /' | sed 's/:/ -p /' | sed 's/@/ /'`

来源:https://forums.meteor.com/t/meteor-mongo-xxx-meteor-com-giving-exception-login-failed-workaround/15289

+0

谢谢Ser。我会尝试并回复你。 –

+1

谢谢Ser。我尝试过,没有sed部分 –

0

由于流星停止配套使用。流星域名和每个开发者都需要自己托管,我发现了一种使用mup或mupx访问远程数据库的方法。我在这篇文章中写道:https://stackoverflow.com/a/37439315/2908071

我希望这能帮助未来的人。