New to MongoDB Can not run command mongo

前端 未结 15 2013
孤独总比滥情好
孤独总比滥情好 2021-01-29 20:00

I was trying to run MongoDB:

   E:\\mongo\\bin>mongod
    mongod --help for help and startup options
    Sun Nov 06 18:48:37
    Sun Nov 06 18:48:37 warning:          


        
15条回答
  •  庸人自扰
    2021-01-29 20:17

    Create the data/db directory in your main (windows) partition:

    C:\> mkdir \data
    C:\> mkdir \data\db
    

    and then go to your mongo_directory/bin and run mongod.exe:

    C:\> cd \my_mongo_dir\bin
    
    C:\my_mongo_dir\bin> mongod
    

    DON't CLOSE THIS WINDOW

    Now in a different command prompt window run Mongo:

    C:\> cd \my_mongo_dir\bin
    C:\my_mongo_dir\bin> mongo
    

    (REMEMBER YOU HAVE TO KEEP THAT OTHER WINDOW OPEN)

    This solved the problem for me.

提交回复
热议问题