Mongo: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145

前端 未结 6 1624
轻奢々
轻奢々 2021-01-31 05:41

When I try to run mongo in shell in ubuntu or open rockmongo I see this error:

couldn\'t connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
         


        
6条回答
  •  天命终不由人
    2021-01-31 06:06

    i got the solution by changing the owner of db directory to 'mongodb'

    `sudo chown -R mongodb:mongodb /data/*`
    

    then type 'mongo'

提交回复
热议问题