MongoDB Manually config


MongoDB Manually config

macOS 10.15.x

path error

exception in initAndListen: NonExistentPath: Data directory /data/db not found.
Create the missing directory or specify another path using (1) the --dbpath command line option,
or (2) by adding the 'storage.dbPath' option in the configuration file.,
terminating 2020-07-16

--dbpath

no default config file exists???

https://github.com/docker-library/mongo/issues/136#issuecomment-274934620

# 手動指定
$ mongod --config /path/to/some/file.conf 
# OR
$ mongod -f /path/to/some/file.conf

https://docs.mongodb.com/manual/reference/configuration-options/#configuration-file

configuration-file

https://docs.mongodb.com/manual/reference/configuration-file-settings-command-line-options-mapping/

https://docs.mongodb.com/manual/administration/configuration/

error ???

$ mongod -f /usr/local/etc/mongod.conf

$ mongos -f /usr/local/etc/mongod.conf


solution

# write 權限

$ sudo chown -R `id -un` /System/Volumes/Data/data/db

# server
$ mongod --dbpath /System/Volumes/Data/data/db

# client
$ mongo

> show databases;

> quit();

MongoDB GUI

Robo 3T

https://robomongo.org/download

refs

MongoDB & macOS (install manually)

https://www.cnblogs.com/xgqfrms/p/9770091.html


Flag Counter

©xgqfrms 2012-2020

www.cnblogs.com 發布文章使用:只允許注冊用戶才可以訪問!



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM