简体   繁体   中英

Run mongod in ZSH shell on Mac and and get command not found

I'm trying to run mongod in my terminal, but I'm getting a command not found . I've consulted other questions on this issue, including this these: mac: command not found: mongod Mongod: Command Not Found (OS X)

But the solutions have not worked for me.

Here is the full path of mongod:

/Users/danno/mongodb/bin/mongod

In.zshrc, I've tried two scripts, but neither one works:

Attempt 1 (from other Stack Overflow questions):

export PATH="$PATH:/usr/local/mongodb/bin"

Attempt 1 (My own guess):

export PATH="$PATH:/Users/danno/mongodb/bin/mongod"

I've restarted the terminal multiple times to no avail.

From the terminal, I'm trying to run:

mongod --dbpath=/Users/danno/mongodb-data

Getting a command not found while running that and also just with mongod alone.

Is something wrong with my pathing?

Maybe you forgot to do this step:

$ source ~/.bash_profile

It is better to put $PATH at the end.

I hope this will help. Additional options can be found in the post and the video.

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