无法创建管理员用户MongoDB

时间:2017-03-03 13:47:48

标签: mongodb

当我尝试通过键入

来学习本教程时
mongod --port 27017 --dbpath /data/db1

控制台以

响应
C:\WINDOWS\system32>mongod --port 27017 --dbpath /data/db1
2017-03-03T14:43:54.019+0100 I CONTROL  [initandlisten] MongoDB starting : pid=1776 port=27017 dbpath=/data/db1 64-bit host=Tim-V5
2017-03-03T14:43:54.020+0100 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-03-03T14:43:54.021+0100 I CONTROL  [initandlisten] db version v3.4.2
2017-03-03T14:43:54.021+0100 I CONTROL  [initandlisten] git version: 3f76e40c105fc223b3e5aac3e20dcd026b83b38b
2017-03-03T14:43:54.022+0100 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips  22 Sep 2016
2017-03-03T14:43:54.023+0100 I CONTROL  [initandlisten] allocator: tcmalloc
2017-03-03T14:43:54.023+0100 I CONTROL  [initandlisten] modules: none
2017-03-03T14:43:54.023+0100 I CONTROL  [initandlisten] build environment:
2017-03-03T14:43:54.023+0100 I CONTROL  [initandlisten]     distmod: 2008plus-ssl
2017-03-03T14:43:54.024+0100 I CONTROL  [initandlisten]     distarch: x86_64
2017-03-03T14:43:54.024+0100 I CONTROL  [initandlisten]     target_arch: x86_64
2017-03-03T14:43:54.025+0100 I CONTROL  [initandlisten] options: { net: { port: 27017 }, storage: { dbPath: "/data/db1" } }
2017-03-03T14:43:54.025+0100 I STORAGE  [initandlisten] exception in initAndListen: 29 Data directory /data/db1 not found., terminating
2017-03-03T14:43:54.026+0100 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2017-03-03T14:43:54.026+0100 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
2017-03-03T14:43:54.027+0100 I CONTROL  [initandlisten] now exiting
2017-03-03T14:43:54.027+0100 I CONTROL  [initandlisten] shutting down with code:100

即使我已经使用

创建了文件夹
mkdir C:\data\db

并检查它是否存在!

跟着

mongo --port 27017

回应
MongoDB shell version v3.4.2
connecting to: mongodb://127.0.0.1:27017/
MongoDB server version: 3.4.2
Server has startup warnings:
2017-03-03T10:02:59.647+0100 I CONTROL  [initandlisten]
2017-03-03T10:02:59.647+0100 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-03-03T10:02:59.647+0100 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-03-03T10:02:59.647+0100 I CONTROL  [initandlisten]

我正在使用Windows 10,我该如何解决这个问题?这很令人沮丧

0 个答案:

没有答案