Creating a database in Mongo: can't connect, get “connect failed”

后端 未结 5 841
刺人心
刺人心 2020-12-13 19:02

I want to create a new database in Mongo. However, I\'m having trouble connecting:

:~$ mongo
MongoDB shell version: 1.6.5
connecting to: test
Tue Dec 21 18:         


        
5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-13 19:59

    First you'll need to run mongod on one terminal. Then fire up another terminal and type mongo. This shall open the mongo shell. You also need to create /data/db/ where mongo will store your databases.

提交回复
热议问题