参考: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. 控制TextField的内容长度

    参考如下代码(下例是控制设置交易密码,控制6位): - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [ ...

  2. org.apache.jasper.JasperException:省略"/html/sysmaintain/authority/user/../../module/verify_login.jsp" not found

    说明了JSP页面里引用安全登录页面的jsp路径代码:<%@ include file="../../module/verify_login.jsp"%>这句代码引用的路 ...

  3. 《.NET之美》消息及勘误

    <.NET之美>消息及勘误 编辑最终还是采用了<.NET之美>作为书名,尽管我一直觉得这个名字有点文艺了,而更倾向于使用<.NET专题解析>这个名称. 目前已经可以 ...

  4. 最流行的编程语言 JavaScript 能做什么?

    此文转载oschina文章 首先很遗憾的一点是,“PHP虽然是最好的语言”,但是它不是最流行的语言. 同时对不起的还有刚刚在4月TIOBE编程语言排行榜上上榜的各个语言: 你们都很棒,但是你们都担当不 ...

  5. Spring:源码解读Spring IOC原理

    Spring IOC设计原理解析:本文乃学习整理参考而来 一. 什么是Ioc/DI? 二. Spring IOC体系结构 (1) BeanFactory (2) BeanDefinition 三. I ...

  6. SQL Server null知多少?

    null是什么? 不知道.我是说,他的意思就是不知道(unknown). 它和true.false组成谓词的三个逻辑值,代表“未知”.与true和false相比,null最难以令人捉摸,因为它没有明确 ...

  7. TroubleShooting笔记--快照进程sp_replupdateschema和索引重建发生冲突

    今天早上服务器出现大面积的阻塞,上去排查blocking,最后大概确定的问题是: rebuild index job(243) --->blocked--->sp_replupdatesc ...

  8. 《Entity Framework 6 Recipes》中文翻译系列 (27) ------ 第五章 加载实体和导航属性之关联实体过滤、排序、执行聚合操作

    翻译的初衷以及为什么选择<Entity Framework 6 Recipes>来学习,请看本系列开篇 5-9  关联实体过滤和排序 问题 你有一实体的实例,你想加载应用了过滤和排序的相关 ...

  9. 《Entity Framework 6 Recipes》中文翻译系列 (34) ------ 第六章 继承与建模高级应用之多条件与QueryView

    翻译的初衷以及为什么选择<Entity Framework 6 Recipes>来学习,请看本系列开篇 6-10  创建一个多条件过滤 问题 你想使用多个条件为实体过滤表中的行. 解决方案 ...

  10. SqlServer英文单词全字匹配

    环境:Vs2013+Sql Server2012 问题:现在数据库记录如下: Sentence列保存的是英文的句子,我现在想找出所有包含“I”(单词)的句子,如果我用 Sentence like '% ...