mongoimport错误-失败:连接到数据库服务器时出错:没有可访问的服务器 [英] mongoimport error - Failed: error connecting to db server: no reachable servers

查看:56
本文介绍了mongoimport错误-失败:连接到数据库服务器时出错:没有可访问的服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试学习mongodb,但无法找到解决该问题的方法. 当我运行mongoimport命令时,出现以下错误:

I am currently trying to learn mongodb and I am having trouble finding a solution for this problem. When I run a mongoimport command it I get the following error:

~ mongoimport --host localhost --port 27017 --db test --collection people --file ~/Downloads/mongodb-consultas.json --jsonArray
2015-09-27T20:46:03.228-0600    [........................] test.people  0.0 B/684.2 KB (0.0%)
2015-09-27T20:46:03.745-0600    Failed: error connecting to db server: no reachable servers
2015-09-27T20:46:03.745-0600    imported 0 documents

我通过在命令行中运行mongod来拥有mongodb服务器.

I have a mongodb server by running mongod in the command line.

我的MongoDB Shell版本是3.0.6.

My MongoDB shell version is 3.0.6.

谢谢!

推荐答案

您需要使用--host 127.0.0.1:27017

You need to use --host 127.0.0.1:27017

这篇关于mongoimport错误-失败:连接到数据库服务器时出错:没有可访问的服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆