通过brew安装好mongdb后,设置了/usr/local/etc/mongod.conf里面的内容如下
systemLog:
destination: file
path: /Users/zyj/database/log/mongodb/mongo.log
logAppend: true
storage:
dbPath: /Users/zyj/database/mongodb
journal:
enabled: true
net:
bindIp: 127.0.0.1
port: 27017
然后启动命令行输入mongod,然后显示
exception in initAndListen: 29 Data directory /data/db not found., terminating
请问如何自定义数据库路径
你虽然是修改了配置文件,但是没有让配置文件生效,要执行命令,让配置文件生效才行