连接时出现MongoDB错误

时间:2018-02-19 14:15:45

标签: javascript database mongodb

我正在关注MongoDB的教程,但是当我尝试运行mongod时,这就是我得到的:

`C:\Program Files\MongoDB\Server\3.6\bin>mongod
2018-02-19T16:10:39.918+0300 I CONTROL  [initandlisten] MongoDB starting : pid=6980 port=27017 dbpath=C:\data\db\ 64-bit host=DESKTOP-7H2SJ95
2018-02-19T16:10:39.919+0300 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-02-19T16:10:39.919+0300 I CONTROL  [initandlisten] db version v3.6.2
2018-02-19T16:10:39.919+0300 I CONTROL  [initandlisten] git version: 489d177dbd0f0420a8ca04d39fd78d0a2c539420
2018-02-19T16:10:39.919+0300 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips  22 Sep 2016
2018-02-19T16:10:39.919+0300 I CONTROL  [initandlisten] allocator: tcmalloc
2018-02-19T16:10:39.920+0300 I CONTROL  [initandlisten] modules: none
2018-02-19T16:10:39.920+0300 I CONTROL  [initandlisten] build environment:
2018-02-19T16:10:39.920+0300 I CONTROL  [initandlisten]     distmod: 2008plus-ssl
2018-02-19T16:10:39.920+0300 I CONTROL  [initandlisten]     distarch: x86_64
2018-02-19T16:10:39.920+0300 I CONTROL  [initandlisten]     target_arch: x86_64
2018-02-19T16:10:39.920+0300 I CONTROL  [initandlisten] options: {}
2018-02-19T16:10:39.920+0300 I STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory C:\data\db\ not found., terminating
2018-02-19T16:10:39.920+0300 I CONTROL  [initandlisten] now exiting
2018-02-19T16:10:39.922+0300 I CONTROL  [initandlisten] shutting down with code:100`

有人可以帮忙吗? 提前谢谢!

1 个答案:

答案 0 :(得分:0)

db内创建C:\data文件夹,databasecollections默认使用此位置保存数据。