简体   繁体   English

在 windows 7 - 64 位上安装 Mongodb

[英]Install Mongodb on windows 7 - 64 bit

I am new to mongodb and not getting how to install it since i dint find videos or any helpful resources to achieve the same.我是 mongodb 的新手,不知道如何安装它,因为我想找到视频或任何有用的资源来实现相同的目标。 Please help me for installing mongodb on windows 7 with the exact steps.请帮助我按照确切的步骤在 windows 7 上安装 mongodb。 I tried downloading recent version of mongodb from the site and its unsuccessful.我尝试从该站点下载最新版本的 mongodb,但未成功。 Thanks in adcance.预先感谢。

Regards,问候,

Vijay维杰

Steps:脚步:

  1. Download MongoDB this link link .下载 MongoDB 此链接链接
  2. Review MongoDB folder.查看 MongoDB 文件夹。

    In MongoDB, it contains only executable files 10 Plus(exe) in the bin folder.在 MongoDB 中,它只包含 bin 文件夹中的可执行文件 10 Plus(exe)。 This is true, and That are the required files to MongoDB, it's really hard to believe for a developer like me Who eats from a relation database background.这是真的,那是 MongoDB 所需的文件,对于像我这样从关系数据库背景吃东西的开发人员来说,真的很难相信。

     path:- Files under $MongoDB/bin folder
  3. Configuration File配置文件

    Create a MongoDB config file, it's just a text file, for example C:\mongodb\mongo.config :创建一个 MongoDB 配置文件,它只是一个文本文件,例如C:\mongodb\mongo.config

     #store data here dbpath=C:\mongodb\data \\all output go here logpath=C:\mongodb\log\mongo.log \\log read and write operations diaglog=3
  4. Run MongoDB server运行 MongoDB 服务器

    Use mongod.exe --config C:\mongodb\mongo.config to start MongoDB server.使用mongod.exe --config C:\mongodb\mongo.config启动 MongoDB 服务器。

     C:\mongodb\bin>mongod --config C:\mongodb\mongo.config

    All output going to: C:\mongodb\log\mongo.log所有 output 转到: C:\mongodb\log\mongo.log

  5. Connect to MongoDB连接到 MongoDB

    Uses mongo.exe to connect to the started MongoDB server.使用 mongo.exe 连接到启动的 MongoDB 服务器。

    C:\mongodb\bin>mongo MongoDB shell version: 2.2.3 connecting to: test C:\mongodb\bin>mongo MongoDB shell 版本:2.2.3 连接到:测试

    //mongodb shell //mongodb shell

  6. MongoDB as Windows Service MongoDB 作为 Windows 服务

    Add MongoDB as Windows Service, so that MongoDB will start automatically following each system restart.将 MongoDB 添加为 Windows 服务,这样 MongoDB 将在每次系统重启后自动启动。 Install as Windows Service with --install .使用--install安装为 Windows 服务。

     C:\mongodb\bin> mongod --config C:\mongodb\mongo.config --install

    A Windows service named “MongoDB” is created.创建名为“MongoDB”的 Windows 服务。

    To start MongoDB Service:启动 MongoDB 服务:

     net start MongoDB

    To stop MongoDB Service停止 MongoDB 服务

    net stop MongoDB

    To remove MongoDB Service删除 MongoDB 服务

    C:\mongodb\bin>mongod --remove

    Reference Link Install Mongodb 参考链接安装Mongodb

For mongoDB 4.x, I got installation hung up several times in "wait for a few minutes..." I changed to v3.2.21-1 as recommended from searching the answer from web.对于 mongoDB 4.x,我在“等待几分钟......”中多次挂起安装,我根据从 web 搜索答案的建议更改为 v3.2.21-1。 It installed very quick and fast as I installed one year ago.它安装得非常快,就像我一年前安装的一样。

  1. firstly you downloaded mongodb from here: https://www.mongodb.com/download-center?jmp=nav#community首先你从这里下载 mongodb: https://www.mongodb.com/download-center?jmp=nav#community
  2. you unzip the folder in your directory example C:\..\MongoDB您解压缩目录中的文件夹示例C:\..\MongoDB
  3. you open the command prompt ( demarrer>Invite commande)您打开命令提示符( demarrer>Invite commande)
  4. you go to your folder where the bin is and you write this on your command prompt: cd c:\..\mongodb\bin您将 go 复制到 bin 所在的文件夹中,然后在命令提示符下写入: cd c:\..\mongodb\bin
  5. then you have to specifies the directory where you want to put the data, you can create a folder called: MongoData, and you whrite on your command prompt: Mongod --dbpath C:\..\MongoData那么您必须指定要放置数据的目录,您可以创建一个名为:MongoData 的文件夹,然后在命令提示符下写入: Mongod --dbpath C:\..\MongoData

在此处输入图像描述

use mongodb-win32-x86_64-2008plus-ssl-3.2.22-signed for Windows7 64 bit对 Windows7 64 位使用 mongodb-win32-x86_64-2008plus-ssl-3.2.22-signed

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM