标签:ebe max init connect tor unit created http 成功
官网下载地址:https://www.mongodb.com/download-center#community
c:\>cd c:
c:\>mkdir data
c:\>cd data
c:\data>mkdir db
c:\data>cd db
c:\data\db>
你也可以通过window的资源管理器中创建这些目录,而不一定通过命令行。
2017-09-26T14:41:23.836+0800 I CONTROL [initandlisten] MongoDB starting : pid=1176 port=27017 dbpath=C:\data\db\ 64-bit host=DESKTOP-64MC4GG
2017-09-26T14:41:23.841+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-09-26T14:41:23.841+0800 I CONTROL [initandlisten] db version v3.4.9
2017-09-26T14:41:23.841+0800 I CONTROL [initandlisten] git version: 876ebee8c7dd0e2d992f36a848ff4dc50ee6603e
2017-09-26T14:41:23.841+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2017-09-26T14:41:23.841+0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-09-26T14:41:23.841+0800 I CONTROL [initandlisten] modules: none
2017-09-26T14:41:23.842+0800 I CONTROL [initandlisten] build environment:
2017-09-26T14:41:23.842+0800 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-09-26T14:41:23.842+0800 I CONTROL [initandlisten] distarch: x86_64
2017-09-26T14:41:23.842+0800 I CONTROL [initandlisten] target_arch: x86_64
2017-09-26T14:41:23.842+0800 I CONTROL [initandlisten] options: {}
2017-09-26T14:41:23.862+0800 I - [initandlisten] Detected data files in C:\data\db\ created by the ‘wiredTiger‘ storage engine, so setting the active storage engine to ‘wiredTiger‘.
2017-09-26T14:41:23.864+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1474M,session_max=20000,eviction=(threads_min=4,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),
2017-09-26T14:41:24.964+0800 I CONTROL [initandlisten]
2017-09-26T14:41:24.965+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-09-26T14:41:24.965+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-09-26T14:41:24.965+0800 I CONTROL [initandlisten]
2017-09-26T14:41:25.652+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory ‘C:/data/db/diagnostic.data‘
2017-09-26T14:41:25.661+0800 I NETWORK [thread1] waiting for connections on port 27017
命令行进入mongoDB的bin目录执行:
mongod.exe --bind_ip yourIPadress --logpath "C:\data\dbConf\mongodb.log" --logappend --dbpath "C:\data\db" --port yourPortNumber --serviceName "YourServiceName" --serviceDisplayName "YourServiceName" --install
如果你需要进入MongoDB后台管理,你需要先打开mongodb装目录的下的bin目录,然后执行mongo.exe文件,MongoDB Shell是MongoDB自带的交互式Javascript shell,用来对MongoDB进行操作和管理的交互式环境。 当你进入mongoDB后台后,它默认会链接到 test 文档(数据库)即命令行进入bin目录后执行:mongo 出现如下信息表示成功:
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.9
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:
2017-09-26T14:41:24.964+0800 I CONTROL [initandlisten]
2017-09-26T14:41:24.965+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-09-26T14:41:24.965+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-09-26T14:41:24.965+0800 I CONTROL [initandlisten]
由于它是一个JavaScript shell,您可以运行一些简单的算术运算:
> 2 + 2
4
> 4+4
8
db 命令用于查看当前操作的文档(数据库):
> db
test
标签:ebe max init connect tor unit created http 成功
原文地址:http://www.cnblogs.com/sinceForever/p/7596885.html