Windows MongoDB 安装
下载
先获取电脑版本,可知我的电脑64位,64位的MongoDB是不能运行在32位系统上的
$ wmic os get caption
Caption
Microsoft Windows 7 Professional
$ wmic os get osarchitecture
OSArchitecture
64-bit
链接 https://www.mongodb.com/download-center?jm... 或者直接点击 http://oaq0p7t2g.bkt.clouddn.com/mongodb-w...= 下载
启动
建立配置文件mongo.conf
vi mongo.conf
#数据库路径
dbpath=D:\mongo\data
#日志输出文件路径
logpath=D:\mongo\log\mongodb.log
#错误日志采用追加模式
logappend=true
#启用日志文件,默认启用
journal=true
#这个选项可以过滤掉一些无用的日志信息,若需要调试使用请设置为false
quiet=true
#端口号 默认为27017
port=27017
进入cmd执行文件目录,用管理员身份运行(重要)
C:\windows\system32>mongod --remove --serviceName "MongoDB"
2018-08-13T17:26:12.069+0800 I CONTROL [main] Trying to remove Windows service
'MongoDB'
2018-08-13T17:26:12.070+0800 I CONTROL [main] Service 'MongoDB' removed
C:\windows\system32>mongod --config "D:\mongo\mongo.conf" --install --serviceNam
e "MongoDB"
C:\windows\system32>net start MongoDB
MongoDB 服务正在启动 ..
MongoDB 服务已经启动成功。
C:\windows\system32>mongo
MongoDB shell version v3.4.1
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.1
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
2018-08-13T17:26:44.632+0800 I CONTROL [initandlisten]
2018-08-13T17:26:44.632+0800 I CONTROL [initandlisten] ** WARNING: Access contr
ol is not enabled for the database.
2018-08-13T17:26:44.632+0800 I CONTROL [initandlisten] ** Read and wri
te access to data and configuration is unrestricted.
2018-08-13T17:26:44.632+0800 I CONTROL [initandlisten]
> show dbs
admin 0.000GB
local 0.000GB
任务管理器可以查看到
工具
图形化工具 https://adminmongo.markmoffat.com/ https://github.com/mrvautin/adminMongo.git
Robomongo http://blog.robomongo.org/robomongo-0-9-0-...
参考
https://vxhly.github.io/2017/05/install-mo...
https://segmentfault.com/a/119000001186484...
http://wiki.jikexueyuan.com/project/mongod...
http://www.runoob.com/mongodb/mongodb-capp...
https://segmentfault.com/a/119000000395160...
本作品采用《CC 协议》,转载必须注明作者和本文链接