MongoDB: exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating

前端 未结 14 1784
轻奢々
轻奢々 2020-12-02 04:37

I created /data/db in root directory and ran ./mongod:

[initandlisten] exception in initAndListen: 20 Attempted to create a lock fi         


        
14条回答
  •  长情又很酷
    2020-12-02 04:56

    On a Mac, I had to do the following:

    sudo chown -R $USER /data/db
    sudo chown -R $USER /tmp/
    

    because there was also a file inside /tmp which Mongo also needed access

提交回复
热议问题