how to set mongod --dbpath

前端 未结 12 1806
囚心锁ツ
囚心锁ツ 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:27

    Create a directory db in home, inside db another directory data

    cd 
    mkdir db
    cd db
    mkdir data
    

    then type this command--

    mongod --dbpath ~/db/data
    

提交回复
热议问题