目前mongo最新版为4.0(2018-07-18),下载地址

 
软件安装
 
 
 
 
 
 
 
 
该安装步骤在本次安装中耗时约20分钟,此时可以先将bin目录加入到环境变量中
 
 
 添加环境变量
 
D:\data\MongoDB\Server\4.0\bin加入到PATH中
 
 
 
之后一路下一步,直到最后连接这一步
 
 
暂时关闭该窗口。
本次安装没有特别地指定数据目录与日志目录,默认为
数据目录D:\data\MongoDB\Server\4.0\data
日志目录D:\data\MongoDB\Server\4.0\log
 
 

mongod 启动数据库

mongod --dbpath “” 启动数据库时指定数据目录,不指定时数据目录默认为安装盘符:\data\db

后台启动
start /b mongod

启动示例

md "D:\data\MongoDB\Server\4.0\data\db"
mongod --dbpath "D:\data\MongoDB\Server\4.0\data\db"

连接数据库

PS D:\Users\Administrator> mongo

MongoDB shell version v4.0.0
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 4.0.0
Server has startup warnings:
2018-07-18T23:36:39.472+0800 I CONTROL [initandlisten]
2018-07-18T23:36:39.472+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-07-18T23:36:39.472+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-07-18T23:36:39.472+0800 I CONTROL [initandlisten]

> db
test
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB

创建数据库

> use vodb
switched to db vodb
> db
vodb

mongodb中的数据库至少要插入一个文档才能显示出来

> db
vodb
> db.chkrecord.insert({
... _id: 100,
... chktime: '2018-07-19 0:10:15',
... chk_key: '75',
... chkname: 'system tbs used pct',
... ipaddress: '192.168.2.116',
... dbname: 'test',
... })
WriteResult({ "nInserted" : 1 })
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
vodb 0.000GB

> db.chkrecord.find().pretty()
{
"_id" : 100,
"chktime" : "2018-07-19 0:10:15",
"chk_key" : "75",
"chkname" : "system tbs used pct",
"ipaddress" : "192.168.2.116",
"dbname" : "test"
}

使用刚才的连接工具MongoDB Compass Community进行连接,不需要修改信息,按默认的连接即可

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

mgo01_window server 2012上安装mongo4.0的更多相关文章

  1. 在Windows Server 2012上安装SharePoint 2010 SP1

    现在很多企业的系统都开始用上了Windows 2012,最近公司需要建立一个门户系统,一开始就想到了微软的SharePoint2010,这玩意确实非常强悍,2008已经褪去,当然直接在Windows ...

  2. Windows Server 2012 上安装 dotNET Framework v3.5

    Windows Server 2012不能直接运行dotNET Framework v3.5安装程序进行安装,系统提供通过服务器管理器的添加功能和角色向导进行安装. 安装的前几个步骤再这里略去,在默认 ...

  3. [转]在 Windows Server 2012 上安装 IIS 8

    本文转自:http://www.starland.net.cn/blog/view/158/1.aspx 本文译自:http://learn.iis.net/page.aspx/1088/instal ...

  4. 在Windows Server 2012 上安装Exchange 2013 服务器

    前文:http://www.cnblogs.com/Liangw/archive/2011/09/19/2559944.html 安装准备: 1.加入一个存在的域(?如何建立一个域) 2.登录Wind ...

  5. mgo03_linux7上安装mongo4.0

    下载地址https://www.mongodb.com/download-center#community tar -xvf mongodb-linux-x86_64-rhel70-4.0.0.tgz ...

  6. 在windows server 2012上安装.net3.5

    1.dism.exe /online /enable-feature /featurename:NetFX3 /Source:D:\sources\sxs /all 2.Start the Local ...

  7. Windows Server 2012上安装.NET Framework 3.5

    引用:https://jingyan.baidu.com/article/14bd256e26b714bb6d26128a.html 装不成功后网上搜到很多相同的问题,都尝试过没解决到 用PowerS ...

  8. Windows Server 2012上安装.NET Framework 3.5(不需要安装光盘)

    因为在windows2012里,安装数据库,IIS部分组件都需要.NET3.5,而默认windows2012安装时,并不会把此组件复制到电脑里 导致,后期要安装.NET3.5还需要安装盘.但是,很多人 ...

  9. sql server 2014 在windows server 2012 上安装Analysis Services

    Analysis Services Account Name : NT AUTHORITY\SYSTEM

随机推荐

  1. python struct.pack中的对齐字节问题

    最近测试涉及到了序列字节化相关问题,碰到一个头疼的问题 buff = struct.pack("3s","B00")    print repr(buff) 输 ...

  2. php学习笔记-if else

    生活不会总是波澜不惊的,要是那样也没有什么意思.代码也一样,if else的出现为平静的生活带来一点变化. <?php $money = 1000; if($money>0) { //sl ...

  3. C语言-郝斌笔记-005菲波拉契序列

    菲波拉契序列 /* 菲波拉契序列 1 2 3 5 8 13 21 34 */ # include <stdio.h> int main(void) { int n; int f1, f2, ...

  4. elasticsearch 6.2.4 安装 elasticsearch-analysis-ik 分词器 (windows 10下)

    访问 https://github.com/medcl/elasticsearch-analysis-ik  找 releases 找到对应的 es 版本 下载 elasticsearch-analy ...

  5. python--爬虫基础

    http://files.cnblogs.com/files/Kobe10/Python__%E7%88%AC%E8%99%AB%E5%9F%BA%E7%A1%80.pdf

  6. 设置datalist指定行的背景色

    前台: <div class="table-responsive" > <table class="table table-bordered table ...

  7. c#创建Table

    private void BindDatazhangting() { DataTable dt = new DataTable(); dt.Columns.Add("channel" ...

  8. C#修饰符讲解大全

    1.修饰符是什么? 修饰符是用于限定类型以及类型成员的声明的一种符号.[百度百科] 2.修饰符分类 13种修饰符,按功能可分为三类:访问修饰符,类修饰符和成员修饰符.[百度百科] 作 用:限定类型以及 ...

  9. Xgboost的sklearn接口参数说明

    from xgboost.sklearn import XGBClassifier model=XGBClassifier(base_score=0.5, booster='gbtree', cols ...

  10. new types may not be defined in a return type(c++语言编译错误,处理)

    在写程序的时候,定义类时要在大括号后面加上: class Point{ public: Point(int a,int b); Point(const Point &p); int getx( ...