Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何通过mongo shell连接到mLab上的MongoDB?_Mongodb_Shell - Fatal编程技术网

如何通过mongo shell连接到mLab上的MongoDB?

如何通过mongo shell连接到mLab上的MongoDB?,mongodb,shell,Mongodb,Shell,我正试图使用服务提供商提到的命令通过mongoshell连接到我在mLab上的数据库集群,但我不断收到提到missing“;”语句的相同错误。我可以通过mongoose客户端访问相同的数据库,没有任何问题 任何我搞砸的线索: mongo ds117956.mlab.com:17956/image_search -u <dbuser> -p <dbpassword> 2017-11-29T03:04:33.139+0530 E QUERY [thread1] Syn

我正试图使用服务提供商提到的命令通过
mongo
shell连接到我在mLab上的数据库集群,但我不断收到提到missing“;”语句的相同错误。我可以通过mongoose客户端访问相同的数据库,没有任何问题

任何我搞砸的线索:

mongo ds117956.mlab.com:17956/image_search -u <dbuser> -p <dbpassword>

2017-11-29T03:04:33.139+0530 E QUERY    [thread1] SyntaxError: missing ; before statement @(shell):1:6
mongods117956.mlab.com:17956/image\u search-u-p
2017-11-29T03:04:33.139+0530 E查询[thread1]语法错误:缺少;声明@(shell)之前:1:6

您需要从mongodb/bin运行 然后输入以下命令:mongods117956.mlab.com:17956/image\u search-u-p

不是来自mongo本身

mongods117956.mlab.com:17956/image_search-u-p


您刚才问了这个问题,但根据错误消息,您似乎试图在
mongo
shell中运行命令,而不是在命令行shell中运行命令(例如Linux上的
bash
,或Windows上的
cmd.exe
)。