MongoDB学习(一)之基本介绍

①MongoDB启动参数说明:

                参数

                  描述

                --bind_ip

绑定服务IP,若绑定127.0.0.1,则只能本机访问,不指定,默认本地所有IP

                --logpath

指定MongoDB日志文件

                --logappend

使用追加方式书写日志

               --dbpath

指定数据库路径

                --port

指定服务端口号,默认为27017

               --serviceName

指定服务名

               --serviceDisplayName

指定服务名(在多个MongoDB服务时执行)

               --install

指定作为一个Windows服务安装

②启动MongoDB服务器的方式:

  1)进入MongoDB目录的bin目录中执行mongod.exe文件(命令行)

         执行命令:

                 1、d:

                 2、cd d:\mongoDBSave\bin

                 3、mongod.exe --dbpath d:\data\db

       出现如下截图中的信息,就是启动成功了。

  2)将MongoDB服务器作为Windows服务来运行

             执行命令:

                 mongod.exe --bind_ip targetIPadress

                                     --logpath " D:\data\dbConf\mongodb.log"

                                     --logappend --dbpath " D:\data\db"

                                     --port targetPortNumber

                                     --serviceName "TargetServiceName"

                                    --serviceDisplayName " TargetServiceName"

                                   --install

③bin文件下的exe文件功能

  mongod.exe:启动MongoDB服务器

   mongo.exe:启动MongoDB Shell

④SQL术语和MongoDB术语比较

注意:术语也就是概念

SQL术语

MongoDB术语

说明

database

database

数据库

table

collection

数据库表/集合

row

document

数据记录行/文档

column

field

数据字段/域

index

index

索引

table joins

 

表连接(MongoDB不支持)

primary key

primary key

主键(MongoDB自动将_id字段设置为主键)

从数据库记录转为MongoDB中的数据   图片转自:https://edu.aliyun.com/lesson_478_4830#_4830

猜你喜欢

转载自blog.csdn.net/tree_ifconfig/article/details/81362563