Win10安裝Mongodb
下載[我下載的zip]
https://www.mongodb.com/download-center/community
配置
解壓mongoDB到自己想要的文件夾
進入解壓后的的mongodb根目錄
我的根目錄F:\chattingSoftWare\mongodb-win32-x86_64-2012plus-4.2.1\
創建 data
和 logs
文件夾
data
文件夾內還有一個db
文件夾
logs
文件夾內新建一個空文件mongo.log
之后在根目錄下創建mongodb的配置文件
mongo.config
文件內容如下 請根據自己的路徑進行修改
# 數據庫路徑
dbpath=F:\chattingSoftWare\mongodb-win32-x86_64-2012plus-4.2.1\data\db
# 日志輸出文件
logpath=F:\chattingSoftWare\mongodb-win32-x86_64-2012plus-4.2.1\logs\mongo.log
# 錯誤日志是否追加
#logappend=true
# 啟用日志文件
journal=true
# 過濾無用日志
quiet=true
port=27017
安裝
以管理員身份運行CMD創建Mongodb服務
以下內容根據自己的路徑情況變更
mongod --config "F:\chattingSoftWare\mongodb-win32-x86_64-2012plus-4.2.1\mongo.config" --install --serviceName "MongoDB"
啟動
net start MongoDB
關閉
net stop MongoDB