[英]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:脚步:
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
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
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
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
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
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.
它安装得非常快,就像我一年前安装的一样。
C:\..\MongoDB
C:\..\MongoDB
cd c:\..\mongodb\bin
cd c:\..\mongodb\bin
Mongod --dbpath C:\..\MongoData
Mongod --dbpath C:\..\MongoData
Download the version 4.0.22 from here从这里下载版本 4.0.22
And follow steps from Use this tutorial to install MongoDB 5.0 Community Edition on Windows using the default installation wizard并按照使用本教程中的步骤使用默认安装向导在 Windows 上安装 MongoDB 5.0 社区版
All the best一切顺利
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.