why can't I start the mongodb

前端 未结 7 556
被撕碎了的回忆
被撕碎了的回忆 2020-12-04 10:10

this is the error:

(mysite)zjm1126@zjm1126-G41MT-S2:~$ /usr/local/mongodb/bin/mongod 
/usr/local/mongodb/bin/mongod --help for help and startup options
Wed A         


        
相关标签:
7条回答
  • 2020-12-04 11:07

    The user account that is starting MongoDB needs to have write privileges to the /data/db/ directory ... you can change this like so ...

    This command will change the owner of the /data/db/ to the user account being used.

    $ sudo chown `id -u` /data/db
    $ mongod 
    

    If you still run into problems with MongoDB starting, you need to delete /data/db/mongod.lock and then run repair on your database ...

    mongod --repair
    

    More about the repair command here.

    0 讨论(0)
提交回复
热议问题