参考:MongoDB 教程 | 菜鸟教程

安装

1.下载安装,从官网下载winows安装包,安装到d盘(注意路径)

2.由于我安装在d盘,所以在d盘创建文件夹data,里面创建db文件夹

3.启动方法:在D:\Program Files\MongoDB\Server\3.2\bin下双击mongod.exe,如下则显示正常:

2016-04-15T21:24:08.293+0800 I CONTROL  [initandlisten] MongoDB starting : pid=6276 port=27017 dbpath=D:\data\db\ 64-bit host=DESKTOP-LPJTSPF
2016-04-15T21:24:08.295+0800 I CONTROL [initandlisten] targetMinOS: Windows Vista/Windows Server 2008
2016-04-15T21:24:08.295+0800 I CONTROL [initandlisten] db version v3.2.5
2016-04-15T21:24:08.296+0800 I CONTROL [initandlisten] git version: 34e65e5383f7ea1726332cb175b73077ec4a1b02
2016-04-15T21:24:08.296+0800 I CONTROL [initandlisten] allocator: tcmalloc
2016-04-15T21:24:08.296+0800 I CONTROL [initandlisten] modules: none
2016-04-15T21:24:08.296+0800 I CONTROL [initandlisten] build environment:
2016-04-15T21:24:08.297+0800 I CONTROL [initandlisten] distarch: x86_64
2016-04-15T21:24:08.297+0800 I CONTROL [initandlisten] target_arch: x86_64
2016-04-15T21:24:08.297+0800 I CONTROL [initandlisten] options: {}
2016-04-15T21:24:08.297+0800 I - [initandlisten] Detected data files in D:\data\db\ created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-04-15T21:24:08.298+0800 W - [initandlisten] Detected unclean shutdown - D:\data\db\mongod.lock is not empty.
2016-04-15T21:24:08.298+0800 W STORAGE [initandlisten] Recovering data from the last clean checkpoint.
2016-04-15T21:24:08.299+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=4G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-04-15T21:24:08.464+0800 I CONTROL [initandlisten]
2016-04-15T21:24:08.465+0800 I CONTROL [initandlisten] ** WARNING: Insecure configuration, access control is not enabled and no --bind_ip has been specified.
2016-04-15T21:24:08.465+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted,
2016-04-15T21:24:08.465+0800 I CONTROL [initandlisten] ** and the server listens on all available network interfaces.
2016-04-15T21:24:08.465+0800 I CONTROL [initandlisten]
2016-04-15T21:24:08.467+0800 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-04-15T21:24:08.467+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'D:/data/db/diagnostic.data'
2016-04-15T21:24:08.468+0800 I NETWORK [initandlisten] waiting for connections on port 27017
2016-04-15T21:24:09.023+0800 I FTDC [ftdc] Unclean full-time diagnostic data capture shutdown detected, found interim file, some metrics may have been lost. OK
2016-04-15T21:24:19.975+0800 I NETWORK [initandlisten] connection accepted from 127.0.0.1:13732 #1 (1 connection now open)

若一闪而过则因为默认在d盘下的data/db文件夹未找到。如果你不想将db放在d:/data/db下也可以指定db位置:

cmd 进入d盘,cd Program Files\MongoDB\Server\3.2\bin,mongod.exe dbpath 指定的位置

这样也可以开启数据库。

4.打开客户端。双击bin目录下的mongo.exe,若不闪退则启动成功。

5.测试:

> db
test
> 1+2
3
> db.runoob.insert({x:10})
WriteResult({ "nInserted" : 1 })
> db.runoob.find()
{ "_id" : ObjectId("5710e88c34bf37767b29a10e"), "x" : 10 }

  

MongoDB初学的更多相关文章

  1. mongodb 初学 目录

    mongodb 初学 索引 啦啦啦 MongoDB 教程 NoSQL 简介 MongoDB 简介 Windows 平台安装 MongoDB Linux平台安装MongoDB mongodb 在 Ubu ...

  2. mongodb 初学 意外 连接服务器异常(Connection refused)

    啦啦啦 这种情况 root@localhost:/# mongo MongoDB shell version: connecting to: test --31T07:: W NETWORK [thr ...

  3. mongodb 初学 索引

    连接服务器异常(Connection refused) 啦啦啦 mongodb 搭建主从服务器 啦啦啦 Mongodb启动命令mongod参数说明 啦啦啦 MongoDB 分片 啦啦啦 啦啦啦 啦啦啦 ...

  4. MongoDB初学笔记(1)

    学习目标 理解MongoDb的特点和体系结构 掌握常用的MongoDB命令 MongoDB是一种介于关系数据库和非关系数据库中的一种数据库.它支持的数据结构非常松散,类似于JSON的BJSOn格式,所 ...

  5. MongoDB初学笔记

    http://www.cnblogs.com/huangxincheng/archive/2012/02/18/2356595.html

  6. 初学mongodb笔记

    先下载下mongodb,这里官网下载,https://www.mongodb.com/download-center?jmp=nav,根据自己的系统选择下载, 然后解压一下:会有这个文件夹\mongo ...

  7. 初学node.js-nodejs连接MongoDB(5)

    一.吧MongoDB的驱动程序添加到Node.js中 Node.js 连接 MongoDB 连接

  8. Mongodb数据库学习系列————(一)Mongodb数据库主从复制的搭建

    Mongodb数据库主从复制的搭建 Writeby:lipeng                                    date:2014-10-22 最近项目上用到了位置查询,在网上 ...

  9. MongoDB学习系列(2)--使用PHP访问MongoDB

    第一部分:介绍 在Windows上安装最新MongoDB步骤非常的简单,这里不做介绍.但是如果你安装的时候没有将MongoDB作为服务运行,每次你都要使用cmd切换到指定的目录下,然后在cmd中启动M ...

随机推荐

  1. eclipse构建maven的web项目

    如果以后要创建maven的web项目,可以参考这个链接 http://blog.csdn.net/smilevt/article/details/8215558/

  2. sublime Text3及其插件的使用

    参考:Sublime Text 3 新手上路:必要的安裝.設定與基本使用教學 Sublime Text 相信是許多開發人員人心目中的最愛,然而對一個 Sublime Text 3 的新手來說,有什麼是 ...

  3. XMPP iOS客户端实现一:服务器

    1.下载ejabberd,下载链接http://www.process-one.net/en/ejabberd/downloads/ 2.安装,使用默认配置即可,next.. 3.启动ejabberd ...

  4. IIS Community Newsletter June 2013

    Announcements Windows 2012 Server R2 preview released Windows Server 2012 R2 provides a wide range o ...

  5. ABP理论学习之开篇介绍

    返回总目录 为了和2016年春节赛跑,完成该系列博客,我牺牲了今天中午的时间来完成该系列的第一篇----开篇介绍.开篇介绍嘛,读过大学教材的同学都知道,这玩意总是那么无聊,跟考试没关系,干脆直接跳过, ...

  6. Lesson 12 Goodby and good luck

    Text Our neighbour, Captain Charles Alison, will sail from Portsmouth tomorrow. We'll meet him at th ...

  7. ASP.Net MVC开发基础学习笔记:三、Razor视图引擎、控制器与路由机制学习

    一.天降神器“剃须刀” — Razor视图引擎 1.1 千呼万唤始出来的MVC3.0 在MVC3.0版本的时候,微软终于引入了第二种模板引擎:Razor.在这之前,我们一直在使用WebForm时代沿留 ...

  8. Net作业调度(四)—quartz.net持久化和集群

    介绍 在实际使用quartz.net中,持久化能保证实例重启后job不丢失. 集群能均衡服务器压力和解决单点问题. quartz.net在这两方面配置都比较简单. 持久化 quartz.net的持久化 ...

  9. String驻留带来的危害

    原创文章转载请注明出处:@协思, http://zeeman.cnblogs.com   前段时间接手了一个项目优化工作,在同等场景下内存使用从4G降低到200M.   项目是将实体序列化成字符串存入 ...

  10. 七天学会ASP.NET MVC (六)——线程问题、异常处理、自定义URL

    本节又带了一些常用的,却很难理解的问题,本节从文件上传功能的实现引出了线程使用,介绍了线程饥饿的解决方法,异常处理方法,了解RouteTable自定义路径 . 系列文章 七天学会ASP.NET MVC ...