成功安装后运行"mongod"命令时权限被拒绝 [英] Permission denied when 'mongod' command is run after successful installation
问题描述
我成功安装了mongodb,然后在运行mongod
命令后出现此错误:
I successfully installed mongodb, then I get this error after running the mongod
command:
2015-08-21T20:48:25.862 + 0530我在initAndListen中存储了[initandlisten]异常:98无法创建/打开锁文件:/data/db/mongod.lock errno:13权限被拒绝是否已经有mongod实例正在运行?,终止 2015-08-21T20:48:25.889 + 0530我控制了[initandlisten] dbexit:rc:100
2015-08-21T20:48:25.862+0530 I STORAGE [initandlisten] exception in initAndListen: 98 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating 2015-08-21T20:48:25.889+0530 I CONTROL [initandlisten] dbexit: rc: 100
我什至做到了并得到以下结果:
I have even done this and got this result:
ls -ld /data/db/
drwxr-xr-x 2 root wheel 68 Aug 21 20:45 /data/db/
推荐答案
授予对db数据文件夹的读写权限,然后重新打开终端,然后尝试mongod.祝你好运.
Give read write permission to db data folder and reopen your terminal and then try mongod. Good luck.
这篇关于成功安装后运行"mongod"命令时权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!