how to set mongod --dbpath

前端 未结 12 1761
囚心锁ツ
囚心锁ツ 2020-12-29 19:50

very new to mongodb and databases in general. whenever i run mongo i receive this error message: ​​​

MongoDB shell version: 2.         


        
12条回答
  •  北海茫月
    2020-12-29 20:43

    You could also configure mongod to run on start up so that it is automatically running on start up and the dbpath is set upon configuration. To do this try:

    mongod --smallfiles --config /etc/mongod.conf

    The --smallfiles tag is there in case you get an error with size. It is, of course, optional. Doing this should solve your problem while also automating your mongodb setup.

提交回复
热议问题