Mongo 不是 运行 全新 MEAN 安装后
Mongo not running after fresh MEAN installation
我是 MEAN 堆栈的新手,所以我正在阅读官方文档:learn.mean.io 并遵循安装 Mongo、npm、gulp 等非常基本的步骤后,在我 运行 带有 gulp 的应用程序之后,我收到以下错误:
错误:首次连接时无法连接到服务器 [localhost:27017] [Mongo错误:连接 ECONNREFUSED 127.0.0.1:27017]
当然,这与 mongo 有关,而不是 运行 在那个特定端口上,我可以单独下载 mongo 和 运行,但不是' t MEAN 应该这样做吗?
我猜你没有 运行 mongodb 服务器..应用程序只会创建连接。使用ip和端口.. Mongo Db你必须单独设置
安装 Mongo 数据库和其他工具以设置 MEAN Stack 后,您需要使用命令提示符启动 Mongo 数据库服务器。
假设我将 Mongo DB 安装在本地磁盘 : D 中名为 "Projects" 的文件夹中,并且我在磁盘 D 本身中有两个名为 Data 和 db 的文件夹,如下所示
D://Projects/mongodb
D://Data/db
1. Open Command Prompt ( CMD )
2. Browse to the folder in which Mongo DB is installed.
3. Create a folder named "Data" and inside Data, another folder named "db". this should reside in the local disk where Mongo DB is installed.
4. To run mongodb server, open CMD in the mongodb installed folder and type "mongod --dbpath=" with your respective path.
5. as per my config: mongod --dbpath=d:/data/db ( i have my data & db folder outside of projects folder )
6. this should start the server with a message, "waiting for connections on port: 27017"
7. after starting the server, you may launch your app or mongo shell to connect to the mongodb server.
在配置文件中,您可以添加路径,这样您就不必在启动服务器时一直指定它。
我是 MEAN 堆栈的新手,所以我正在阅读官方文档:learn.mean.io 并遵循安装 Mongo、npm、gulp 等非常基本的步骤后,在我 运行 带有 gulp 的应用程序之后,我收到以下错误:
错误:首次连接时无法连接到服务器 [localhost:27017] [Mongo错误:连接 ECONNREFUSED 127.0.0.1:27017]
当然,这与 mongo 有关,而不是 运行 在那个特定端口上,我可以单独下载 mongo 和 运行,但不是' t MEAN 应该这样做吗?
我猜你没有 运行 mongodb 服务器..应用程序只会创建连接。使用ip和端口.. Mongo Db你必须单独设置
安装 Mongo 数据库和其他工具以设置 MEAN Stack 后,您需要使用命令提示符启动 Mongo 数据库服务器。
假设我将 Mongo DB 安装在本地磁盘 : D 中名为 "Projects" 的文件夹中,并且我在磁盘 D 本身中有两个名为 Data 和 db 的文件夹,如下所示
D://Projects/mongodb
D://Data/db
1. Open Command Prompt ( CMD )
2. Browse to the folder in which Mongo DB is installed.
3. Create a folder named "Data" and inside Data, another folder named "db". this should reside in the local disk where Mongo DB is installed.
4. To run mongodb server, open CMD in the mongodb installed folder and type "mongod --dbpath=" with your respective path.
5. as per my config: mongod --dbpath=d:/data/db ( i have my data & db folder outside of projects folder )
6. this should start the server with a message, "waiting for connections on port: 27017"
7. after starting the server, you may launch your app or mongo shell to connect to the mongodb server.
在配置文件中,您可以添加路径,这样您就不必在启动服务器时一直指定它。