成功安装后运行"mongod"命令时权限被拒绝 [英] Permission denied when 'mongod' command is run after successful installation

查看:503
本文介绍了成功安装后运行"mongod"命令时权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功安装了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屋!

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