Mongod:找不到命令(OS X) [英] Mongod: Command Not Found (OS X)

查看:1028
本文介绍了Mongod:找不到命令(OS X)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试测试MongoDB,并将其全部下载并移到了根文件夹中.我可以导航到保存mongod的文件夹,但是当我尝试通过在终端中键入"mongod"来运行它时,我收到一条消息,提示:

I am trying to test MongoDB and I have it all downloaded and moved into the root folder. I can navigate to the folder that holds the mongod, but when I try to run it by typing "mongod" into my terminal, I get a message that says:

"mongod:找不到命令"

"mongod: command not found"

推荐答案

以上两个答案都是正确的. 您可以在以下文件之一中指定路径:.profile,.bashrc或.bash_profile

Both answers above are correct. You can either specify the path in one of the following files: .profile, .bashrc, or .bash_profile

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

然后直接调用守护程序或外壳程序

then call the daemon or the shell directly

mongod
mongo

或者对于不在$ PATH中的命令,请使用包含这些文件的目录中的./mongo或./mongod.如果从另一个目录调用这些命令时最终必须追加整个路径,则该解决方案可能很冗长.

Or for the commands not in the $PATH, use ./mongo or ./mongod from the directory containing these files. This solution can be verbose has you will have to eventually append the whole path when calling these commands from another directory.

/usr/local/mongodb/bin/mongod
or
/usr/local/mongodb/bin$ ./mongod 

这篇关于Mongod:找不到命令(OS X)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆