简体   繁体   中英

mongodb installation on mac using brew with zsh

I'm using zsh and installed mongo using: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

when trying to use mongod --config /usr/local/etc/mongod.conf --fork I get:

➜  ~ brew list
gettext         openjdk         scala@2.11
git         pcre2
mongodb-community@4.0   sbt
➜  ~ brew services start mongodb-community@4.0
Service `mongodb-community@4.0` already started, use `brew services restart mongodb-community@4.0` to restart.
➜  ~ mongod --config /usr/local/etc/mongod.conf --fork
zsh: command not found: mongod

Can someone help?

It looks like you haven't set path variable for mongodb. You can set it in .zshrc file.

Open.zshrc file in vim using vim ~/.zshrc then paste the following line

export PATH="<your mongodb bin folder path>:$PATH"

in my case the path is

/Users/namardeepsood/Development/mongodb/bin

save this file and run source ~/.zshrc to refresh the current shell environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM