exception in initAndListen: 29 Data directory /data/db not found., terminating
macOS OS(10.15) Catalina,Mongodb 运行报错: /data/db not found
exception in initAndListen: 29 Data directory /data/db not found., terminating
macOS Catalina 升级之后,OS 不在允许在 /
目录下有写的操作(read-only system),之前的 /data/db 被移除了。
所以Mongodb要想正常运行,需要改变dbpath。
mongod --dbpath ~/data/db
将Mongodb 的data放在 home 目录下。需要手动创建~/data/db 目录。